This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import zipfile | |
FOLDERS_TO_EXCLUDE = ['Applications', 'Downloads', 'Movies', 'Music', 'Public', 'node_modules'] | |
def zipdir(path, ziph): | |
for root, dirs, files in os.walk(path): | |
dirs[:] = [x for x in dirs if ( | |
x not in FOLDERS_TO_EXCLUDE) and (not x.startswith('.'))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mengus> tamam | |
<mengus> o zaman ba$liyoruz | |
<mengus> dersi aib ile birlikte anlatacagiz parca parca | |
<mengus> i$leyecegimiz konular $oyle: | |
<mengus> - "Program" neye denir, nasil cali$ir. | |
<mengus> - kod nedir, data nedir, nasil i$lenir | |
<mengus> - degi$ken nedir, nasil kullanilir | |
<mengus> - ozel kelimeler (reserved keywords) | |
<mengus> - statement nedir, nasil kullanilir | |
<mengus> - fonksiyon nedir, yenir mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mengus> ba$layalim madem | |
<mengus> Veritabani neye denir oncelikle? | |
<mengus> bir veritabani, birbiriyle ilintili verileri | |
<mengus> saklamaya, ve daha sonra bu verilere eri$meye yarayan | |
<mengus> bir sistemdir | |
<mengus> en basit veritabani ornegi olarak | |
<mengus> (dunyadaki tum veritabani tutoriallarindaki bir ornek olarak) | |
<mengus> telefon rehberlerini ele alabiliriz | |
<mengus> bir telefon rehberinde neler vardir? | |
<mengus> isimler ve telefonlar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this in conjunction with https://github.com/jishi/node-sonos-http-api | |
import urllib.request | |
import json | |
import time | |
BANNED_ARTISTS = ['drake'] | |
while True: | |
state = json.loads(urllib.request.urlopen("http://localhost:5005/state").read().decode('utf-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var options = { | |
'auth': { | |
'user': 'USER', | |
'pass': 'PASS', | |
'sendImmediately': false | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var options = { | |
'auth': { | |
'user': 'USER', | |
'pass': 'PASS', | |
'sendImmediately': false | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace this: | |
for (const value of myArray) { | |
console.log(value) | |
} | |
// with: | |
forEach(value => console.log(value), myArray) | |
const double = x => x * 2 | |
map(double, [1, 2, 3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install jq | |
$ echo "alias pasc='cat package.json | jq -r .scripts'" >> ~/.bashrc | |
$ source ~/.bashrc | |
$ pasc | |
{ | |
"start": "node server.js", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script confirms that the version we have now doesn't already exist in npm | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
CYAN='\033[0;36m' | |
NC='\033[0m' | |
# Version key/value should be on its own line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getValue = function(value, cb) { | |
setTimeout(function err() { | |
throw Error(); | |
}, 0); | |
return cb(null, value); | |
}; | |
var result = getValue(5, (err, a) => { | |
console.log(a); | |
}); |
NewerOlder