Skip to content

Instantly share code, notes, and snippets.

View snj33v's full-sized avatar
🏠
Working from home

Sanjeev snj33v

🏠
Working from home
  • Tamil Nadu, India
View GitHub Profile
/**
* dualshock4.h - DualShock 4 USB HID Report Helper
*
* NOTE: Do not use this for production purposes, it's far from complete and is my
* initial attempt at working with USB HID. If it doesn't work, too bad.
* (Hoping to put this into content/browser/gamepad someday. If I ever finish.)
**
* Copyright (c) 2014 Sangwhan Moon
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@admalledd
admalledd / obs_deps.sh
Last active September 20, 2016 10:03
Helper script to compile obs-studio. Gets the needed depenancies for you!
#!/bin/bash
set -e #quit on error stuff!
#This script was only testing on linux mint 16, with a large pile of custom tweaking.
#This file should be used more as a "guide line" than anything else...
# PLEASE edit certain settings before going around and running this! to make sure of that I
# have the next line kill the script unless commented out!
echo "You forgot to set up this file! Edit it with correct paths to use!" && exit 0
anonymous
anonymous / ds4.cpp
Created December 17, 2015 19:00
example of using libhid to read and write a playstation DS4 controller (wired)
// quick hack job by @mmalex
// thanks to libhid author and @johndrinkwater and https://github.com/chrippa/ds4drv
#include <stdio.h>
#include "hidapi.h" // using http://www.signal11.us/oss/hidapi/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#pragma pack(push, 1)
@bakercp
bakercp / sgx_build_modules.sh
Created May 22, 2013 04:04
Building / Installing / Running SGX modules on the Beagle Bone Black
#!/bin/bash -e
#
# Copyright (c) 2012-2013 Robert Nelson <robertcnelson@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
/* * * * * * *
Main File
Tristan Madden
1/3/2018
* * * * * * * */
//ffmpeg -i test.mp4 -i music.mp3 -codec copy -shortest output.mp4
//ffmpeg -r 60 -f image2 -s 3840x2160 -i frame-%04d.tif -c:v libx264 -preset slow -profile:v high -crf 9 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low test4.mp4
OpenSimplexNoise noise;
@smutneja03
smutneja03 / VerhoeffValidator.java
Created April 1, 2017 07:45
Algorithm to check whether an aadhaar number is valid or not
public class VerhoeffValidator {
/**
* @see <a href="http://en.wikipedia.org/wiki/Verhoeff_algorithm/">More
* Info</a>
* @see <a href="http://en.wikipedia.org/wiki/Dihedral_group">Dihedral
* Group</a>
* @see <a href="http://mathworld.wolfram.com/DihedralGroupD5.html">Dihedral
* Group Order 10</a>
* @author Colm Rice
*/
@kgaughan
kgaughan / hlm2-dewad
Created March 15, 2015 06:33
Extracts resources from Hotline Miami 2 WAD files
#!/usr/bin/env python
"""\
Extract files from Hotline Miami 2 WAD files.
Usage:
hlm2-dewad --help
hlm2-dewad [--flatten] <wad-path> [<path>]
hlm2-dewad --list <wad-path>
Options:
// Making an anonymous recursive function
// --------------------------------------
// 1. Create a basic *named* factorial function, which recursively calls itself
function factorial(n) {
if (n === 0) {
return 1;
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@tesu
tesu / un360.glsl
Last active December 14, 2023 22:38
mpv opengl shader for viewing 360 video
//!HOOK MAINPRESUB
//!BIND HOOKED
//!DESC un360
#define M_PI 3.1415926535897932384626433832795
const float fov = M_PI/2; // [0 to M_PI] horizontal field of view, range is exclusive
const float yaw = M_PI*1; // [any float] polar angle, one full revolution is 2*M_PI
const float pitch = M_PI*0; // [any float] vertical tilt, positive is up
const float roll = M_PI*0; // [any float] view rotation, positive is clockwise