Skip to content

Instantly share code, notes, and snippets.

View forivall's full-sized avatar
🕴️
levitating

Emily Marigold Klassen forivall

🕴️
levitating
View GitHub Profile
@dalcib
dalcib / ngGrid.js
Created May 7, 2012 20:18
Angular Grid
//////////////////////////////////////
/// Grid Directive to Angular 1.0.0rc7
//////////////////////////////////////
// To use:
// <script>
// var app = angular.module('myapp', ['ngGrid']);
// var Ctrl = function($scope) { $scope.todo = [...] }
// </script>
// <div ng-app="myapp">
var h = require('hyperscript');
var CronJob = require('cron').CronJob;
var nodemailer = require('nodemailer');
var craigslist = require('node-craigslist');
var options = {
category : 'cta',
maxAsk : '9000',
minAsk : '1000'
};
generateUniqueID = () ->
_p8 = (s) ->
p = (Math.random().toString(16)+"000000000").substr(2,8)
if s then "-" + p.substr(0,4) + "-" + p.substr(4,4) else p
_p8() + _p8(true) + _p8(true) + _p8()
@joshkunz
joshkunz / vlcwrap.c
Last active December 22, 2015 03:29
Wrapper that will close VLC on OSX with a SIGKILL when it receives a SIGINT (useful if you want to terminate it from the command-line with Control-C).
/* Build, (with your favorite compiler) run:
* cc -o vlcwrap vlcwrap.c */
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define VLC_BIN "/Applications/VLC.app/Contents/MacOS/VLC"
{
init: function(elevators, floors) {
var floorButtons = new Array(floors.length);
var floorTime = new Array(floors.length);
var UP = 1;
var DOWN = 2;
var DISABLED = 4;
for (var i = 0; i < floorButtons.length; i++) {
floorButtons[i] = 0;
floorTime[i] = 0;
@getify
getify / 1.js
Created September 8, 2016 22:37
trying to figure out how closure works over params and body-vars
function foo(x,y = function(){ return x; }) {
console.log( "a:", x );
var x = 1;
console.log( "b:", y() );
}
foo(2);
@brianarn
brianarn / akkala-lyrics.txt
Created April 4, 2017 21:43
Akkala (cover of "Africa" by Toto)
I hear no princess in the night
But Link hears all her whispers of defenestration
He’s coming in, paraglider flight
The sheikah slate reflects the past that guides him toward salvation
Got stopped by an old man along the way
Hoping to find some long forgotten tech or ancient memories
He turned to me as if to say, “Hurry boy, she’s waiting there for you"
It's gonna take a lot to clean up all that evil goo
There's nothing in a hundred years or more that they could do
@natchiketa
natchiketa / yo-completion.sh
Last active May 25, 2018 20:47
Bash completion for Yeoman generators
# Bash completion for Yeoman generators - tested in Ubuntu, OS X and Windows (using Git bash)
function _yo_generator_complete_() {
# local node_modules if present
local local_modules=$(if [ -d node_modules ]; then echo "node_modules:"; fi)
# node_modules in /usr/local/lib if present
local usr_local_modules=$(if [ -d /usr/local/lib/node_modules ]; then echo "/usr/local/lib/node_modules:"; fi)
# node_modules in user's Roaming/npm (Windows) if present
local win_roam_modules=$(if [ -d $(which yo)/../node_modules ]; then echo "$(which yo)/../node_modules:"; fi)
# concat and also add $NODE_PATH
local node_dirs="${local_modules}${usr_local_modules}${win_roam_modules}${NODE_PATH}"
@keikoro
keikoro / repo_from_cli.md
Last active November 14, 2018 15:42
Create repositories on GitHub, GitLab, Bitbucket from the command line.

there's a bash script for this now: clirepo

@smashercosmo
smashercosmo / generate.js
Created May 22, 2019 12:45
Generate fake data out of TypeScript types
const execa = require('execa')
const jsf = require('json-schema-faker')
;(async () => {
const { stdout } = await execa(
'./node_modules/.bin/ts-json-schema-generator',
[
'--path',
'./organizations.ts',
'--type',