Skip to content

Instantly share code, notes, and snippets.

View nicksarafa's full-sized avatar
😄

Nick Sarafa nicksarafa

😄
  • Los Angeles
View GitHub Profile
@nicksarafa
nicksarafa / sphereBox.pde
Created February 18, 2018 17:53 — forked from beesandbombs/sphereBox.pde
sphere box
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
int seed = int(random(999999));
void setup() {
size(960, 960, P2D);
smooth(8);
pixelDensity(2);
rectMode(CENTER);
generate();
@nicksarafa
nicksarafa / function_invocation.js
Created June 19, 2017 01:55 — forked from myshov/function_invocation.js
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@nicksarafa
nicksarafa / export_repo_issues_to_csv.py
Created June 6, 2017 17:36 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@nicksarafa
nicksarafa / .vimrc
Last active January 8, 2018 06:50 — forked from joegoggins/.vimrc
Mac Vim .vimrc file
" ================ Git Time Tracking ================
" ================ @see https://github.com/git-time-metric/gtm-vim-plugin ================
let g:gtm_plugin_status_enabled = 1
" ================ Pathogen Init ====================
execute pathogen#infect()
syntax on
filetype plugin indent on

Vimium Cheatsheet

/ - enter find mode

F - activate link hints mode to open in new tab

G - scroll to bottom of the page

J - go one tab left

@nicksarafa
nicksarafa / docker-log.sh
Created May 27, 2017 21:48 — forked from yarcowang/docker-log.sh
simple bash script to show log for a docker image
#!/usr/bin/env bash
DOCKER=`which docker`
usage()
{
echo "Usage: $(basename $0) [-l num] IMAGE"
exit 0
}
@nicksarafa
nicksarafa / GIF-Screencast-OSX.md
Created May 11, 2017 00:08 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@nicksarafa
nicksarafa / nstime.js
Created November 3, 2016 19:47 — forked from ericelliott/nstime.js
Convert Node's process.hrtime() return values to nanoseconds
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
@nicksarafa
nicksarafa / fibonacci-lookup.js
Created November 3, 2016 19:04 — forked from ericelliott/fibonacci-lookup.js
A lookup table implementation of the Fibonacci generator in JavaScript.
const lookup = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,
987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393,
196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465,
14930352, 24157817, 39088169, 63245986, 102334155, 165580141, 267914296,
433494437, 701408733, 1134903170, 1836311903, 2971215073, 4807526976,
7778742049, 12586269025, 20365011074, 32951280099, 53316291173, 86267571272,
139583862445, 225851433717, 365435296162, 591286729879, 956722026041,
1548008755920, 2504730781961, 4052739537881, 6557470319842, 10610209857723,
17167680177565, 27777890035288, 44945570212853, 72723460248141,
117669030460994, 190392490709135, 308061521170129, 498454011879264,