Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
zaydek-old / mv.sh
Last active September 10, 2016 00:40
echo 'cd $1; mv $2.txt $2.sh; bash $2.sh; mv $2.sh $2.txt' # " -> '
document.getElementsByClassName('slide sqs-gallery-design-stacked-slide')[0].getElementsByTagName('img')[0].src // " -> '
imgs=(static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/574db7618259b5a818c67e19/1464711033056/IMG_7496Edited.jpg?format=1500w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/574db287d51cd48913eec356/1464710401609/IMG_7165Edited-2.jpg?format=1000w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/574db2a4d51cd48913eec49e/1465696247484/IMG_7167Edited-2.jpg?format=1000w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/575cbf28c6fc08a91276642d/1465696225607/IMG_8065.jpg?format=2500w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/574db1e2d51cd48913eebd1b/1464710401059/IMG_7162Edited.jpg?format=1000w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de7bc23571c2/574db1ced51cd48913eebc62/1464710400872/IMG_7157Edited-2.jpg?format=2500w
static1.squarespace.com/static/574cb9103c44d8bd12bead7e/574db100ab48de
on replace(s, f, r)
set AppleScript's text item delimiters to f
set _ to text items in s
set AppleScript's text item delimiters to r
text items of _ as string
end replace
replace("AppleScript", "Apple", "Java")
osascript <<!
on rename(dir, ext, f, r)
repeat with s in list folder dir
if s contains "." & ext then
set text item delimiters to f
set _ to text items in s
set text item delimiters to r
text items of _ as string
do shell script "mv " & quoted form of (dir & s) & " " & quoted form of (dir & result)
end if
@zaydek-old
zaydek-old / curlt.sh
Last active September 10, 2016 00:49
stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl/#answer-22625150
function curlt { curl -o /dev/null -s -w '%{time_connect} + %{time_starttransfer} = %{time_total}\n' $1; } # " -> '
osascript <<!
set vols to {¬
"/Volumes/SSD/", ¬
"/Volumes/SSD2/"}
on DS_Store(vols)
repeat with vol in vols
set {cont, dest} to {true, ""}
repeat while cont is true
try
cd /Volumes/SSD2/; git clone https://github.com/zaydek/zaydek.github.io; mv zaydek.github.io zaydek; cd zaydek; git add -A; git commit --allow-empty-message -m ''; git push -u origin master
@zaydek-old
zaydek-old / frame.sh
Last active September 10, 2016 00:31
HandBrake + vidme + Imgur
osascript -e 'tell app "QuickTime Player" to current time of document 1'
@zaydek-old
zaydek-old / dock.sh
Last active September 9, 2016 04:34
Hide; Apps; Size
defaults write com.apple.dock autohide -bool true; defaults write com.apple.dock static-only -bool true; defaults write com.apple.dock size-immutable -bool true; killall Dock; killall Terminal