This file contains hidden or 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
| // Stripped down jQuerify for modern browsers: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet | |
| (function() { | |
| var f = function() { | |
| jQuery.noConflict()(function($) { | |
| // Bookmarklet code goes here | |
| }); | |
| }; | |
| if (typeof jQuery != 'undefined') { |
This file contains hidden or 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
| // Please let me know if one approach is better than the other | |
| (function(arg) { | |
| alert(arg); | |
| return arguments.callee; | |
| }('foo')('bar')('baz')); | |
| (function f(arg) { | |
| alert(arg); |
This file contains hidden or 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
| #!/bin/bash | |
| numberOfShows=`curl --silent http://thomyorketickets.waste.uk.com/Store/DisplayItems.html | grep -c "time to be confirmed"` | |
| while true; do | |
| if [ "$numberOfShows" -ne "5" ]; then | |
| while true; do | |
| `say check for tickets` | |
| sleep 5 | |
| done |
This file contains hidden or 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
| import org.mozilla.javascript.Context; | |
| import org.mozilla.javascript.ContextFactory; | |
| import org.mozilla.javascript.Scriptable; | |
| import org.mozilla.javascript.tools.shell.Global; | |
| import org.mozilla.javascript.tools.shell.Main; | |
| public class ScriptTest { | |
| public static void main(String[] args) { | |
| final Context cx = ContextFactory.getGlobal().enterContext(); | |
| cx.setOptimizationLevel(-1); |
This file contains hidden or 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
| document.location.href = 'mailto:?subject=' + document.title + '&body=' + document.location.href; |
This file contains hidden or 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
| $.each([ | |
| { images: ['foo.jpg', 'foo2.jpg'], interval: 200 }, | |
| { images: ['bar.jpg', 'bar2.jpg'], interval: 300 } | |
| ], function(index, animation) { | |
| $('<img/>') | |
| .attr('src', animation.images[0]) | |
| .load(function () { | |
| var $img = $(this), count = 0; | |
| $img.unbind(); |
This file contains hidden or 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
| function stringify(value) { | |
| if (typeof value === 'string') { | |
| return '"' + value.replace('"', '\"') + '"'; | |
| } else if (!value || typeof value !== 'object') { | |
| return value; | |
| } | |
| if (Object.prototype.toString.call(value) === '[object Array]') { | |
| var entries = []; |
This file contains hidden or 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
| rvm use system | |
| rm use 1.9.2 | |
| gem install tumblr_client | |
| gem query --local | |
| tumblr |
This file contains hidden or 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
| typedef void (^BlockType)(id); | |
| void (^blockName)(void) = ^{ | |
| // Code | |
| }; | |
| @property (nonatomic, copy) void (^blockName)(void); | |
| - (id)initWithBlock:(void(^)(void))blockName; |
This file contains hidden or 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
| if [ -f "errors.txt" ]; then `rm errors.txt`; fi; for file in *.csv; do `tail -n +2 "$file" | | |
| cut -d , -f 3 >> /tmp/errors`; done; sort /tmp/errors > errors.txt; rm /tmp/errors; less errors.txt |
OlderNewer