Skip to content

Instantly share code, notes, and snippets.

View samermurad's full-sized avatar

Samer Murad samermurad

View GitHub Profile
@wyatt8740
wyatt8740 / sdljoytest.cpp
Created February 21, 2014 16:34
SDL Joystick Button ID finder
/* SDLJOYTEST
Prints the ID numbers of SDL input devices when activated.
EXAMPLE: if you are trying to find the SDL button ID of the 'A' button on
an imaginary gamepad or joystick, run this program and then press
the 'A' button on your joystick. As long as it is working properly,
the program will print the IDs of whatever buttons are being held down,
allowing you to enter that ID into a config file for inputs.
So say the 'A' button prints an ID of '5'. That means that the ID
5 is what you should enter for the config file.
@woods
woods / gen-key-script
Last active October 31, 2024 23:23
Creating gpg keys non-interactively
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: [email protected]
Expire-Date: 0
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
--# Main
-- Skeletal Animation
--helper function for matrix vector maths
function matrixByVector(m, v)
m=m:transpose()
vx = vec4(m[1], m[2], m[3], m[4]):dot(v)
vy = vec4(m[5], m[6], m[7], m[8]):dot(v)
vz = vec4(m[9], m[10], m[11], m[12]):dot(v)
vw = vec4(m[13], m[14], m[15], m[16]):dot(v)
@richieforeman
richieforeman / makeauthority.sh
Created July 23, 2012 21:38
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@aheckmann
aheckmann / storeImgInMongoWithMongoose.js
Created April 17, 2012 19:14
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@Neil-Smithline
Neil-Smithline / idletime.sh
Created March 18, 2012 15:33
Mac OS X Idle Time Shell Script
#!/bin/sh
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'