Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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";}'