Skip to content

Instantly share code, notes, and snippets.

@delebash
delebash / kssnodetojson.js
Last active November 19, 2018 09:27
outputs kss to json string
//install kss and fs-extra: npm install kss fs-extra
var kss = require('kss'),
options = {
markdown: false
};
var fs = require('fs-extra');
var file = './docs/kss.json';
@eduardosilva
eduardosilva / gist:8288209
Created January 6, 2014 19:21
Script to calculate age in javascript
birthday = Date.parse('2013/03/27');
age = ~~((Date.now() - birthday) / (31557600000));
@datchley
datchley / README.md
Last active March 23, 2019 21:00
Micro templating library for javascript

Micro-Template: README.md

Valid template expressions:

  • expressions can reference any property on the passed in context, including nested properties and indexed access to array properties.
     {{ name }}
 {{ obj.name }}
@kflorence
kflorence / scrollbarWidth.js
Created July 10, 2012 22:13
Calculate scroll bar width cross-browser
function getScrollBarWidth() {
var inner = document.createElement('p');
inner.style.width = "100%";
inner.style.height = "200px";
var outer = document.createElement('div');
outer.style.position = "absolute";
outer.style.top = "0px";
outer.style.left = "0px";
outer.style.visibility = "hidden";
@marklundin
marklundin / HomographyUtil.as
Created November 1, 2010 13:37
Computes a Matrix3D homography from source and destination coplanar points
package math{
import flash.geom.Matrix3D;
import flash.geom.Point;
/**
*
* @author Mark Lundin
*
* Based upon code provided by nicoptere - http://www.nicoptere.net/AS3/homographie/blog/Homography.as
* The findHomography now computes a Matrix3D that maps the transformation between two sets of complanar points.
git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@benjjo
benjjo / shiftOutDisplay
Last active July 1, 2019 18:09
Shiftbit registers can be a little tricky to setup so I designed this simple Hello World code for doing just that. This example uses a 74HC595 Shift Register in conjunction with a common anode seven segment display. This code is designed to shift the "HIGH" value on the Shift Bit Register from Q0-Q7. This is achieved by sending the values 1,2,4,…
/*
********************************************************************
Name : shiftOutDisplay, Test code
Author : Benjo Charlie
Date : 13 Sept, 2013
Version : 1.0
Notes : Shiftbit registers can be a little tricky to setup so I
: designed this simple Hello World code for doing just that.
: This example uses a 74HC595 Shift Bit Register in conjunction
: with a common anode seven segment display.
@OliverJAsh
OliverJAsh / foo.ts
Last active November 7, 2019 06:42
TypeScript URL helpers
import urlHelpers, { Url, UrlWithParsedQuery, UrlWithStringQuery } from 'url';
import queryStringHelpers from 'querystring';
import { Option } from 'funfix-core';
import pipe from 'lodash/flow';
import { ParsedUrlQuery } from 'querystring';
const isNonEmptyString = (str: string) => str.length > 0;
// https://github.com/gcanti/fp-ts/blob/15f4f701ed2ba6b0d306ba7b8ca9bede223b8155/src/function.ts#L127
const flipCurried = <A, B, C>(fn: (a: A) => (b: B) => C) => (b: B) => (a: A) =>
@shuffle2
shuffle2 / dbg.py
Created July 8, 2015 08:23
powersaves-amiibo-frida stuffs
'''
Input MD5 : BB4E83D7A77AADD7F62728314EF09461
File Name : C:\Program Files (x86)\Powersaves For AMIIBO\Powersaves For AMIIBO.exe
0x108fd0 : schannel_recv -> log buffer on end
0x1090d0 : schannel_recv end
0x108d10 : schannel_send -> log buffer on start
0xce61 : deals with https "Token"
0xceab : deals with https "Vuid"
@stoikerty
stoikerty / gist:40ee7d3ee6016a485092
Last active April 9, 2020 18:59
Mixin for creating Google’s “Material Design” in SCSS
// Creating Google’s “Material Design” in SCSS
// (specifically Material Shadow, uses compass)
// see: http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-paper-craft
// Demo: http://codepen.io/stoikerty/full/Glwxi/
// Animating Box-Shadow is EXPENSIVE:
// http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/#toc-
// Moving between z-index-depths is done via opacity & multiple