Skip to content

Instantly share code, notes, and snippets.

TheMengzor / gist:2012343ca608f9f1b069
Created Jun 3, 2014
Get AppStore Apps Icons list
View gist:2012343ca608f9f1b069
// Paste this code in Console at
// The take a look at the end of page
$('.grid3-column li a').each(function(){
$('<div>').load($(this).attr('href'), function(){$('body').append('<div>' + $(this).find('.product .artwork img').attr('src') + '</div>')});
View gist:0f680157fd525b4cd486
rsync -aHAXOxv --numeric-ids --delete --rsync-path="sudo -u www-data -i rsync" -e "ssh -T -c arcfour -o Compression=no -x" --exclude="exclude" ./local/path
TheMengzor / topsites.js
Created Oct 23, 2014
Safari TopSites Preview Detection
View topsites.js
if (window.navigator && window.navigator.loadPurpose === "preview") {
window.location.href = ""
TheMengzor / gist:968e5ea87e99d9c41782
Created Nov 28, 2014
BASH Absolute path of current script
View gist:968e5ea87e99d9c41782
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from

These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:

while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
View gist:1a264bc84f100e756035
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
if appIsRunning("QuickTime Player") then
tell application "QuickTime Player"
delay 1
close document 1 saving no
View gist:41225ef43176f7582078
<!DOCTYPE html>
<script src=""></script>
<input type="text" id="url"/> <button id="send">play</button>
TheMengzor / gist:6cc7caa68256aa4871cf
Created Apr 29, 2015
VirtualBox OS X parameters
View gist:6cc7caa68256aa4871cf
VBoxManage.exe modifyvm "Yosemite 10.10 Retail" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "Yosemite 10.10 Retail" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "Yosemite 10.10 Retail" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Yosemite 10.10 Retail" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Yosemite 10.10 Retail" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Yosemite 10.10 Retail" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
View gist:ae0a878d91df80f713cf
View .screenrc
termcapinfo xterm ti@:te@
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # Tell screen how to set colors. AB = background, AF=foreground
hardstatus alwayslastline
hardstatus string '%{= w}%-w[ %{= g}%n %t%{-} ]%+w%=%{=b r}%H%{-} %{= Y}%l%{-} %{=b m}%d.%m.%Y %c:%s%{-}'
nethack on
scrollback 20000
defscrollback 20000
altscreen on
TheMengzor /
Last active May 17, 2017
CLI speedtest
curl -fsSL | python -