View gitpushserverhookgitpull.git
GitHookPushToServer
https://stackoverflow.com/questions/24382150/git-hook-make-server-pull-after-i-push-to-github
cd ~/example && mkdir .git && cd .git && git init --bare
cat > hooks/post-receive << EOF
> #!/bin/sh
> GIT_WORK_TREE=~/example git checkout -f
> EOF
chmod +x hooks/post-receive
View disable.sh
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
View index.html
<canvas id="canvas" style="position:absolute; top:0; left:0;"></canvas>
<div id="buffer" style="display:none;">
View index.html
<canvas id="canvas" style="position:absolute; top:0; left:0;"></canvas>
<div id="buffer" style="display:none;">
View index.haml
/* Original is 1600px by 1200px */
/* I want width of 900pxxso */
/* (90x0/1600)*1200 = 675px */
/* Surface area of back is then */
/* 900 * 675 = 607500 */
/* 607500 / ( 10 * 10) = */
/* 6075 */
/* 607500/50 = 12150 */
View download-embedded-vimeo-video.js
downloadEmbededVideos();
/**
* Finds and downloads all embeded Vimeo videos.
*/
function downloadEmbededVideos() {
// Find Vimeo embed frame
var embedFrames = document.querySelectorAll('iframe[src*="player.vimeo.com"]');
View .sh
#!/bin/bash
brew install openssl libmicrohttpd
git clone https://github.com/fireice-uk/xmr-stak-cpu
cd xmr-stak-cpu
mkdir build && cd build
cmake -DHWLOC_ENABLE=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ ..
make
View interview
# well not sure how far u wanted that to go..
# I had to google some quick info/docs. for ex forgot method notation meaning of !
# Otherwise I think import stuff should be here. Relationships of models (which I am not 100% on but
# I would figure it out from docs if spent more time..), business logic, exceptions and
# transactions..
# I havent used rails in a while so little rusty but I know I could always get back up to speed
# really quick.. Had to learn React this week for ex..
# Hope its good enough, left a lot of comments to explain the craziness. Thanks for your time
View AnotehrITerator
var arr = [4,5,6,7,8,9];
for (var v of arr) {
console.log( v );
}
// 4 5 6 7 8 9
// define iterator that only produces values
// from odd indexes
arr[Symbol.iterator] = function*() {
var idx = 1;
do {
View wtfES6
let fibonacci = {
[Symbol.iterator]() {
let pre = 0, cur = 1;
return {
next(p) {
console.log(p);
pre = cur
cur = pre + cur
//[pre, cur] = [cur, pre + cur];
if (cur < 100) {