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 / rn-android-clean-run.sh
Created January 8, 2018 11:16
Clean and run android react-native build
`cd android && ./gradlew clean && ./gradlew assembleDebug --stacktrace`
@nicksarafa
nicksarafa / react-native-kill-ios.sh
Last active January 7, 2018 04:27
react-native kill iOS
echo "alias rnkill=\"kill \$(lsof -t -i:8081); rm -rf ios/build/; react-native run-ios\"" >> ~/.zshrc; source ~/.zshrc
@nicksarafa
nicksarafa / index.sh
Created October 3, 2017 05:39
Update all of your vim pathogen plugins and dependencies
cd ~/.vim/bundle
for i in `ls`; do
cd "$i"
git pull
cd ..
done
Install the following...
MacVim
WebStorm
iTerm 2
@nicksarafa
nicksarafa / bash-stats.md
Last active June 20, 2017 01:29
Sweet little one liner that returns the top 25 most frequent commands ran inside your shell

bash-stats

history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n25


Example results

 1	2165 21.6522% git
@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