Skip to content

Instantly share code, notes, and snippets.

@mobilemind
mobilemind / xcode-setup-gist.sh
Last active January 7, 2019 23:12
Xcode setup commands
## Xcode 2019
# remove old simulators in Xcode 9 or Xcode 10
xcrun simctl delete unavailable
# solve issue with `xcrun: error: unable to find utility "name", not a developer tool or in PATH`
sudo xcode-select --reset
## Xcode 2011
defaults write com.apple.Xcode PBXBeepOnNoMatchingBrace YES
defaults write com.apple.Xcode NSRecentDocumentsLimit 12
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{FULLUSERNAME="Firstname Last";ORGANIZATIONNAME="Orgname";}'
@mobilemind
mobilemind / ets-8-item2.js
Last active April 11, 2016 06:52
ETS: 8 Hrs to Item 2 & submit
// javascript:if(!location.href.match(%2Fetswsso.web.(.*%3F).com.etsp.ets%2F))void(location.href%3D'https%3A%2F%2Fetswsso.web.PLACEHOLDER.com%2Fetsp%2Fetslg9pm')%3Bvar%20d%3Ddocument.getElementsByName('contents')%5B0%5D.contentDocument,h%3Dd.getElementsByName('hours001')%5B0%5D,t%3Dd.getElementsByName('ccnsel001')%5B0%5D,e%3Dd.createEvent('HTMLEvents')%3Bh.value%3D8%3Bt.selectedIndex%3D2%3Be.initEvent('change',false,true)%3Bt.dispatchEvent(e)%3Bvoid(d.getElementsByName('lmform')%5B0%5D.submit())
//verify on correct page
if (!location.href.match(/etswsso.web.(.*?).com.etsp.ets/)) void (location.href = 'DESIRED_URL');
// enter 8 hours for activity #2 on ETS
// setup vars for DOM elements and event
var d = document.getElementsByName('contents')[0].contentDocument,
h = d.getElementsByName('hours001')[0],
t = d.getElementsByName('ccnsel001')[0],
e = d.createEvent('HTMLEvents');
@mobilemind
mobilemind / viewsource.js
Created July 18, 2012 18:25
View Source Bookmarklet from Mark Damon Hughes <http://kuoi.com/~kamikaze/read.php?id=276>
javascript:{document.documentElement.innerHTML%20='<head><title>View%20Source<\/title><\/head>\n'+'<body><p>Source%20of%20<a%20href=\''+location.href+'\'>'+location.href+'<\/a><\/p>\n'+'<pre>\n&lt;'+document.documentElement.nodeName+'&gt;\n'+(document.documentElement.innerHTML).replace(/\&/g,%20'&amp;').replace(/</g,%20'&lt;').replace(/>/g,%20'&gt;')+'\n&lt;/'+document.documentElement.nodeName+'&gt;\n<\/pre><\/body>\n';}
@mobilemind
mobilemind / parallel-adverts-off.sh
Created July 25, 2012 16:10
Parallels adverts off
#!/usr/bin/env bash
defaults write com.parallels.Parallels\ Desktop ProductPromo.ForcePromoOff -bool YES
@mobilemind
mobilemind / node-proxy.sh
Created July 26, 2012 03:44
node npm proxy
npm config set proxy http://proxy_host:port
@mobilemind
mobilemind / unnstall-java.sh
Created July 7, 2013 23:38
uninstall Java on OS X
#!/bin/sh
# Java VM sym link
sudo ln -s /Library/Java/JavaVirtualMachines /System/Library/Java/JavaVirtualMachines
# Java browser plugin
sudo rm -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@mobilemind
mobilemind / setFileDateToEXIFDate
Created May 10, 2014 00:26
set file date to EXIF date
# depends on exiftool
for TKJF in photo\(?\).jpg
do touch -t "$(exiftool -DateTimeOriginal -S "$TKJF" | awk '{gsub(":","",$0); print $2 substr($3, 1, 4) "." substr($3, 5, 6) }')" "$TKJF"
done
@mobilemind
mobilemind / remove_exif_orientation.sh
Created May 15, 2015 19:10
remove orientation information from iPhone JPEG image using exif on jpg file
for PHOFILE in Photo*.jpg ; do exiftool -Orientation='' "$PHOFILE" ; done
@mobilemind
mobilemind / rtm-add.js
Created April 11, 2016 06:51
Remember the Milk bookmarklet to add current selected text & web page as a task due tomorrow using RTM Mobile web app
// javascript:%28function%28%29%7Bvar%20n%2Cw%3Bif%28window.getSelection%29n%3Dwindow.getSelection%28%29%3Belse%20if%28document.getSelection%29n%3Ddocument.getSelection%28%29%3Belse%20if%28document.selection%29n%3Ddocument.selection.createRange%28%29.text%3Bw%3Dwindow.open%28%27https%3A%2F%2Fm.rememberthemilk.com%2Fadd%3Fname%3D%27%2BencodeURIComponent%28null%3D%3D%3Dn%7C%7Cundefined%3D%3D%3Dn%7C%7C%27%27%3D%3Dn%3Fdocument.title%3An%29%2B%27%26due%3Dtomorrow%26url%3D%27%2BencodeURIComponent%28location.href%29%2C%27addwindow%27%2C%27status%3Dno%2Ctoolbar%3Dno%2Cwidth%3D475%2Cheight%3D260%2Cresizable%3Dyes%27%29%3BsetTimeout%28function%28%29%7Bw.focus%28%29%7D%2C475%29%7D%29%28%29%3B
// (function(){var n,w;if(window.getSelection)n=window.getSelection();else if(document.getSelection)n=document.getSelection();else if(document.selection)n=document.selection.createRange().text;w=window.open('https://m.rememberthemilk.com/add?name='+encodeURIComponent(null===n||undefined===n||''==n?document.title:n)+'&due=tomorrow&u