Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
| -- Stefan van den Oord, 2010-12-29 | |
| -- The "cd to" command for iTerm2 | |
| -- Original from: http://code.google.com/p/iterm2/wiki/AppleScript | |
| -- Modified to open a new tab instead of a new window | |
| tell application "Finder" | |
| set _cwd to POSIX path of ((folder of (front window)) as alias) | |
| end tell | |
| tell application "iTerm" |
| // 1: how could you rewrite the following to make it shorter? | |
| if (foo) { | |
| bar.doSomething(el); | |
| } else { | |
| bar.doSomethingElse(el); | |
| } | |
| // See my blog post: | |
| // http://benalman.com/news/2010/09/partial-application-in-javascript/ | |
| // In the following code sample, invoking the curried function will always | |
| // return a function until all arguments are satisfied, at which point the | |
| // original function is invoked, returning its result. This means that all | |
| // function arguments are required, which also allows the function to be | |
| // called either like foo( 1, 2, 3 ) or foo( 1 )( 2 )( 3 ). This also means | |
| // that if any argument is omitted, the original function is never invoked. |
| 王 | |
| 江 | |
| 周 | |
| 胡 | |
| 刘 | |
| 李 | |
| 吴 | |
| 毛 | |
| 温 | |
| 习 |
| #!/usr/bin/env node #// -*- Mode: Node.js JavaScript; tab-width: 4; -*- | |
| /* | |
| --- | |
| url: http://gist.github.com/441101 | |
| name : safari-get-html | |
| description : safari-get-html will rock your socks! | |
| authors : Thomas Aylott | |
| copyright : © 2010 Thomas Aylott | |
| license : MIT |
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Updated: 2010/12/05 | |
| // | |
| // the regular expression composed & commented | |
| // could be easily tweaked for RFC compliance, | |
| // it was expressly modified to fit & satisfy | |
| // these test for an URL shortener: |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| /* | |
| * filterify | |
| * | |
| * Copyright (c) 2012 "Cowboy" Ben Alman | |
| * Licensed under the MIT license. | |
| * http://benalman.com/about/license/ | |
| */ | |
| Function.prototype.filterify = function filterify() { | |
| var args = arguments.length > 0 ? [].slice.call(arguments) : [filterify]; |
| (function (exports) { | |
| var supportsGCS = "defaultView" in exports.document && "getComputedStyle" in exports.document.defaultView; | |
| function getStyle(element, property) { | |
| // `element.ownerDocument` returns the used style values relative to the | |
| // element's parent document (which may be another frame). `defaultView` | |
| // is required for Safari 2 support and when retrieving framed styles in | |
| // Firefox 3.6 (https://github.com/jquery/jquery/pull/524#issuecomment-2241183). | |
| var style = supportsGCS ? element.ownerDocument.defaultView.getComputedStyle(element, null) : element.currentStyle; | |
| return (style || element.style)[property]; |