This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Setup: | |
-- 1. Open with Apple Script editor | |
-- 2. Export as "Application" with "Run only" flag | |
-- 3. Add to your dock. Happy PDF preview! | |
set webBrowser to "Firefox" -- or Safari | |
set pdfMenuItemTitle to "Open PDF in Preview" -- the title of the menu item you want | |
set myDelay to 0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// animated route transition workaround for ember | |
// this workaround only deals with the current view | |
// if you need to animate the new and the old view in parallel this won't help you. | |
App.ApplicationRoute = Ember.Route.extend({ | |
actions: { | |
willTransition: function(transition){ | |
if(!this.isInTransition){ | |
// stop transition until animation is complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = Ember.Application.create({ | |
collections: Ember.Object.create({ | |
products: null | |
}) | |
}); | |
App.set("collections.products", Ember.ArrayProxy.create({ | |
content: [], | |
all: function(params){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.toCurrency = function() { | |
var value; | |
if (isNaN(this) || !isFinite(this)) { | |
return '-'; | |
} | |
value = Math.abs(this).toFixed(2); | |
value = value.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); | |
return (this < 0 ? '-$' : '$') + value; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hi from test.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// needs jQuery trollollooo | |
// example: report("fontSize") | |
// example: report("fontSize", false) // reports the elements which have the given properties | |
function gather(prop){ | |
var reduce = function(result, item){ | |
var $item = $(item); | |
var propValue = $item.css(prop); | |
result[propValue] = result[propValue] || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed | |
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2" |
OlderNewer