Skip to content

Instantly share code, notes, and snippets.

View avanderberg's full-sized avatar

Alexander van der Berg avanderberg

View GitHub Profile
@ThePredators
ThePredators / readme-mde.md
Last active June 8, 2024 09:56
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

mac=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo $mac
sudo ifconfig en0 ether $mac
@hdragomir
hdragomir / droidshot.sh
Last active August 29, 2015 14:00
droidshot - simple cli utility that wraps taking screenshots from an android phone
function droidshot {
saveto=~/droidshots
fname=$(date +"%Y%m%d%H%M").png
[[ ! -z $1 ]] && fname=$1
[[ -d $saveto ]] || mkdir $saveto
adb shell screencap -p /sdcard/$fname
adb pull /sdcard/$fname $saveto/$fname
adb shell rm /sdcard/$fname
echo "saved to $saveto/$fname"
}
@DouglasSherk
DouglasSherk / mac_address_randomize.sh
Last active August 29, 2015 13:56
MAC Address Randomizer
#!/usr/bin/bash
# You might want to note your old MAC address here. Use this to get it:
# ifconfig en0 | grep ether
MAC_ADDRESS=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo "Setting MAC address..."
sudo ifconfig en0 ether $MAC_ADDRESS
ifconfig en0 | grep ether
@thevurt
thevurt / facebook_login.rb
Created September 18, 2012 11:51
Allows click on the Facebook "OK" button once the SDK opens safari taken from https://groups.google.com/d/msg/frank-discuss/V4F6ZZB5aCk/goA3I535a8IJ
def click_fb_okay_button
%x{osascript<<APPLESCRIPT
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
set the position of the first window to {1, 1, 1, 1}
delay 1
@janl
janl / gist:3110170
Created July 14, 2012 09:23
CoUp Coffee Chemex Guide

Chemex Quick Guide

Not this is rocket sience :)

Water

Fill the water heater with a finger more than 1 liter of water. Set it on its power-base, hit the button that’s all the way out on the handle. This starts the heating process. Now hit the “minus” (“-”) button so you see a red light on the 90° marker. Let it heat up. In the meantime:

Beans

@jboner
jboner / latency.txt
Last active July 8, 2024 16:46
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@illicitonion
illicitonion / rach3.py
Created May 20, 2012 02:36
Rachmaninov's Third Piano Concerto, Played by Selenium
from selenium import webdriver
from time import sleep
d = webdriver.Chrome()
d.get('http://mrcoles.com/piano/')
sleep(2)
d.execute_script('document.querySelector(\'.keys\').style.width=\'791px\' ; var es = document.querySelectorAll(\'.black\') ; for (var e = 0 ; e < es.length ; ++e) { es[e].style.width = \'1px\'; }')
keymap = {'a': [-3, 9], 'a#': [-2, 10], 'bb': [-2, 10], 'b': [-1, 11], 'c': [-12, 0, 12], 'c#': [-11, 1], 'd': [-10, 2], 'd#': [-9, 3], 'eb': [-9, 3], 'e': [-8, 4], 'f': [-7, 5], 'f#': [-6, 6], 'g': [-5, 7], 'g#': [-4, 8]}
def key(letter, pos):
@felixge
felixge / postverzollung.txt
Created May 4, 2012 13:33
Example for not wasting your time at the customs office
TO: zollamt-schoeneberg@zab-schoeneberg.bfinv.de (usually provided on the card you get)
Sehr geehrtes Zollamt,
am DD.MM.YYYY erhielt ich ein Schreiben über den Eingang einer Sendung bei der keine Rechnung angebracht war.
lfd. Nr: <NR>
Empfänger: <Name>, <Adresse>, <PLZ> <Ort>
Bei dem Paket handelt es sich um ein T-Shirt das mir geschenkt wurde da ich in meiner Freizeit kostenlose Software für die Integration mit einem Datenanalyse Dienst geschrieben habe (siehe http://support.metrics.librato.com/knowledgebase/articles/53548). Das T-Shirt ist vermutlich mit dem Logo des Dienstes bedruckt / hat keinen offiziellen Marktwert. Die Materialkosten sind wahrscheinlich ~20 EUR.
@tlossen
tlossen / xing.rb
Created March 30, 2012 12:47
extract emails from vcf file
#! /usr/bin/env ruby
puts(open("vcards-XING.vcf").lines.map do |line|
$1.chomp if line =~ /^EMAIL.*:(.*)$/
end.compact.uniq.join(','))