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.
/** | |
* A really simple template function. | |
* | |
* USAGE: | |
* | |
* 1. Ivoke `prepareTemplate(template)` by provide template string as an argument | |
* 2. The above invocation returns another function which called by with data argument | |
**/ | |
function prepareTemplate(template) { |
### | |
# | |
# Echo string in color based on `--type`. | |
# Read `colorEcho()` funncton for more info on type. | |
# | |
# AUTHOR: | |
# | |
# Saophalkun Ponlu (phalkunz@gmail.com) | |
# | |
### |
### | |
# Returns a code that determine whether local branch and its origin's counterpart | |
# are in sync. In sync, in this case, means there's no commits in local branch | |
# that have not been pushed to the origin. In short, it means the following | |
# command returns nothing. | |
# | |
# git log {branch} --not origin/{branch} | |
# | |
# The code will be be in `$?` variable after the funciton call. | |
# The status code can be: |
// 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 */ | |
} |
# 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. |
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'" | |
function isFlashInstalled() { | |
try { | |
if(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) return true; | |
}catch(e){ | |
if(navigator.mimeTypes["application/x-shockwave-flash"] !== undefined) return true; | |
} | |
return false; | |
} |
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.
/** | |
* Profiling (running time). For dev purpose only. | |
*/ | |
(function() { | |
window._profiler = { | |
'profiles': [] | |
}; | |
_profiler.time = function(name) { | |
_profiler.profiles[name] = new Date(); | |
}; |