Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.
In XCode's Preferences > Downloads you can install command line tools.
(function(d, s) { | |
var js, fjs = d.getElementsByTagName(s)[0], load = function(url, id, callback) { | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s);js.src = url;js.id = id;js.async=true; | |
fjs.parentNode.insertBefore(js,fjs); | |
if(callback!=undefined) { | |
js.onload=callback; | |
//Extra for internet explorer | |
js.onreadystatechange = function () { if(this.readyState == 'complete' || this.readyState == 'loaded') { callback(); } } | |
} |
/** | |
* Photoshop script for preparing a sprite for rotating animation. | |
* Input : a starting sprite and number of frames | |
* Output: the specified number of layers ready to be used in the PS animation tool | |
*/ | |
var docRef = app.activeDocument; | |
var activeLayer = docRef.activeLayer; | |
var degToRotate = null; | |
var newLayer = null; |
/** | |
* Returns a literal object with properties mapped to the query string variables | |
* For example: | |
* input (page url): http://www.test.com/index?one=1&two=2 | |
* value: { 'one': 1, 'two': 2 } | |
*/ | |
function urlVars() { | |
var search = window.location.search; | |
if(search === '' || !search || search === '?') { |
/** | |
* Profiling (running time). For dev purpose only. | |
*/ | |
(function() { | |
window._profiler = { | |
'profiles': [] | |
}; | |
_profiler.time = function(name) { | |
_profiler.profiles[name] = new Date(); | |
}; |
Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.
In XCode's Preferences > Downloads you can install command line tools.
function isFlashInstalled() { | |
try { | |
if(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) return true; | |
}catch(e){ | |
if(navigator.mimeTypes["application/x-shockwave-flash"] !== undefined) return true; | |
} | |
return false; | |
} |
git log --since='1am' --author=$(git config user.email) --format='%h — %an (%ar) %s' | |
# Output with colors | |
# $ git log --since='1am' --author=$(git config user.email) --format='%Cred%h%Creset — %an (%ar) %Cgreen%s%Creset' | |
# To set up git alias, run the following command once | |
# $ git config --global alias.log-today "log --since='1am' --author=$(git config user.email) --format='%h — %an (%ar) %s'" | |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
// Source: https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/ | |
if ( | |
('ontouchstart' in window) || | |
(navigator.maxTouchPoints > 0) || | |
(navigator.msMaxTouchPoints > 0) | |
) { | |
/* browser with either Touch Events of Pointer Events | |
running on touch-capable device */ | |
} |