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
| def pbcopy(string) | |
| pasteBoard = NSPasteboard.generalPasteboard | |
| pasteBoard.declareTypes([NSStringPboardType], owner: nil) | |
| pasteBoard.setString(string, forType: NSStringPboardType) | |
| end |
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
| var Timezone = { | |
| set : function() { | |
| var date = new Date(); | |
| date.setTime(date.getTime() + (1000*24*60*60*1000)); | |
| var expires = "; expires=" + date.toGMTString(); | |
| document.cookie = "timezone=" + (-date.getTimezoneOffset() * 60) + expires + "; path=/"; | |
| } | |
| } |
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/sh -e | |
| # Usage: gem-publish resque.gemspec | |
| # Builds and publishes a RubyGem. | |
| GEM=`gem build $1 2> /dev/null | grep File: | sed -e 's/File://'` | |
| gem push $GEM | |
| rm $GEM |
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
| # Because Unicorn is such a brilliant piece of software, it wraps older, | |
| # non-Rack versions of Rails in a Rack handler. That way Unicorn | |
| # itself can target Rack and not have to worry about monkey patching | |
| # Rails' dispatcher. | |
| # | |
| # This means we can do the same, and even more. | |
| # | |
| # Starting Rackhub locally: | |
| # | |
| # Thin: |
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
| window.onorientationchange = function() { | |
| if (window.orientation == 0) { | |
| $('#sidebar').fadeOut() | |
| } else { | |
| $('#sidebar').fadeIn() | |
| } | |
| } |
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
| require 'mustache' | |
| class Layout < Mustache | |
| self.template = "Header | |
| {{{yield}}} | |
| Footer" | |
| end | |
| class Index < Mustache | |
| self.template = "The Index." |
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
| $ curl -s http://github.com/soveran/resque/commit/437b7736b9436c57c8d47a52f714daf849c40189.patch | wc -c | |
| 35046 | |
| $ curl -s http://github.com/defunkt/redis-namespace/commit/45811085eef9db6711ba73a8d575196e0ef8e962.patch | wc -c | |
| 1245 |
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
| require 'mustache' | |
| Mustache::Parser::ALLOWED_CONTENT = /(\w|[?!\/.-])*/ | |
| class ImplicitIterator < Mustache | |
| define_method "." do | |
| self[:to_s] | |
| end | |
| def names |
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
| # Fails on 1.9.1p376 | |
| require 'test/unit' | |
| require 'mustache' | |
| class MTest < Test::Unit::TestCase | |
| def test_array_of_arrays | |
| template = <<template | |
| {{#items}} | |
| start |
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
| ripenv_prompt () { | |
| _OLDPS1="$PS1" | |
| PS1="{\$(rip-env)}$PS1" | |
| } | |
| ripenv_no_prompt () { | |
| PS1="$_OLDPS1" | |
| } |