Skip to content

Instantly share code, notes, and snippets.

View steelx's full-sized avatar
🎮
GameDev by night

Ajinkya Borade steelx

🎮
GameDev by night
View GitHub Profile
@pmeissner
pmeissner / layout.jade
Created August 15, 2013 17:04
Wireframe layout template file.
- var site_url = 'https://s3.amazonaws.com/creative_loupe/website/demos/wireframing'
- var site_name = 'Wireframing Inc'
- var layout = ''
- var section = ''
- var sidebar_content = ''
block vars
doctype
//if IE 8
@xoddong
xoddong / gist:48efe0bda921fee06fff
Created July 9, 2015 18:22
Multiply Function
var multiply = function() {
var _args = [].slice.call(arguments);
var length = _args.length;
if (Array.isArray(this)) {
this.push(_args.pop());
if (this.length === 3) {
return (this[0] * this[1] * this[2]);
}
@alexdiliberto
alexdiliberto / curry.js
Created May 4, 2014 15:48
Curry functions in Javascript with variable argument lengths
function toArray(args) {
return [].slice.call(args);
}
function sub_curry(fn /*, variable number of args */) {
var args = [].slice.call(arguments, 1);
return function () {
return fn.apply(this, args.concat(toArray(arguments)));
};
}
@rishikeshdhokare
rishikeshdhokare / git_refresh
Last active June 5, 2018 05:04
git pull all the repositories in a directory
#!/bin/bash
for d in ./*/;
do (
cd "$d" &&
currentDir=`pwd`
echo "updating `basename "$currentDir"`..."
git pull
);
done
@Mithrandir0x
Mithrandir0x / disable_wifi_hotspot.bat
Last active August 20, 2018 09:30
Two little batch files to create a cozy WiFi hotspot from the laptop Snatched from xda-developers, yet I don't remember the thread. Kudos to the author.
netsh wlan stop hostednetwork
pause
@busypeoples
busypeoples / TestSetupExampleCRAEnzymeChaiMocka.md
Last active May 13, 2019 13:07
Mocha/Chai/Enyzme test setup with create-react-app

Basic setup for using Enzyme/Mocha/Chai with create-react-app

This is a temporary solution. Might change in the near future, this depends on how create-react-app will implement testing.

create-react-app quick-test-example

cd quick-test-example

npm run eject
@EtienneR
EtienneR / Gulpfile.js
Created March 17, 2016 14:56
Auto reload your Go webserver with Gulp
const gulp = require('gulp'),
util = require('gulp-util'),
notifier = require('node-notifier'),
sync = require('gulp-sync')(gulp).sync,
reload = require('gulp-livereload'),
child = require('child_process'),
os = require('os');
var server = null;
@nnarhinen
nnarhinen / Gruntfile.js
Last active February 11, 2020 09:39
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
#!/bin/bash
# The binary is most likely to have the current directory name
PROCESS=${PWD##*/}
# We kill the previous process
killall ${PROCESS}
# We launch the process
go build
@ardinusawan
ardinusawan / TOTP.java
Created December 4, 2016 16:10
RFC 6238 OTP - 10 digits (Modified from https://tools.ietf.org/html/rfc6238)
import java.lang.reflect.UndeclaredThrowableException;
import java.security.GeneralSecurityException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.math.BigInteger;
import java.util.TimeZone;