Skip to content

Instantly share code, notes, and snippets.

View Asynchronousx's full-sized avatar
:shipit:
Focusing

Asynchronousx

:shipit:
Focusing
View GitHub Profile
@Asynchronousx
Asynchronousx / camera.cpp
Created November 3, 2022 11:52
Barebone FPS Camera with MOUSE/KEYBOARD movement using Freeglut/Opengl
#define _CRT_SECURE_NO_WARNINGS
#define TO_RADIANS 3.141592/180.0
#include <GL/freeglut.h>
#include <iostream>
// angles and starting position
float xangle = 0.0f, yangle = 1.0f, zangle = -1.0f;
// XYZ position of the camera
@Asynchronousx
Asynchronousx / remove_audio.sh
Last active January 27, 2020 12:27
Remove MP3 audio files shorter than X seconds from a folder.
#!/bin/bash
# Simple bash script that will remove MP3 audio file from a folder, if their duration in seconds
# does not match the passed duration input. Note: the script must be executed in the interested folder.
function get_duration {
total_len=0
for file in `pwd`/*; do
cur_len=$(ffprobe -i $file -show_entries format=duration -v quiet -of csv="p=0")
cur_len=${cur_len%.*}
total_len=$((total_len+cur_len))
@Asynchronousx
Asynchronousx / tfdigit.py
Last active December 1, 2019 20:49
Tensorflow Digit Classifier
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import os
#optional: suppress some CPU warnings
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# Here, we're acceding throu keras to datasets presents into the lib
mnist = tf.keras.datasets.mnist #28x28 images of handwritten digits
@Asynchronousx
Asynchronousx / wowclscript.lua
Last active July 22, 2021 00:10
World of Warcraft Classic Macro script: Item stack Splitter
-- WoW Classic LUA Macro that allows SPLITING ITEM STACK fast.
-- Usage: Just positionate the cursor on the item stack you want to divide, and spam the macro
local pos=GetMouseFocus()
local x,y=pos:GetParent():GetID(), pos:GetID()SplitContainerItem(x,y,1)
for i=0,4 do for j=1, -- change j if want more than one item splitted each time
GetContainerNumSlots(i)
do
if not GetContainerItemID(i,j)
then PickupContainerItem(i,j)
@Asynchronousx
Asynchronousx / Client.java
Last active April 30, 2019 15:52
Simple socket communication between a client and a server in Java
import java.net.*;
import java.io.*;
import java.util.Scanner;
public class Client {
//In the client, we just need one socket: The socket we'll going to connect with: the one related
//to the server.
private Socket ssock;
//Also, we need a reader and a writer to communicate with the server, and a scanner for the input.