- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb - Download and install the powssl script
$ curl https://raw.github.com/gist/2050941/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl$ chmod +x ~/bin/powssl - Run powssl to create development certificate and configure stud.
$ powssl
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
| # app/views/users/_user.json.jbuilder | |
| json.(user, :id, :name, :age, :gender) |
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(typeof(console) === 'undefined') { | |
| var console = {}; | |
| console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {}; | |
| } |
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
| # This is a work in progress. I use it in production and it works very well, but use at your own risk! | |
| @initCJAX = () -> | |
| History = @History | |
| $ = @jQuery | |
| document = @document | |
| return false unless @History.enabled | |
| $ -> | |
| contentSelector = ".main" |
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
| class @GroupActionMenuHandler | |
| bind: -> | |
| @handler_instance = this | |
| $(document).on 'click', '.group-action-menu a', (e) => | |
| alert @handler_instance |
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
| class @GroupActionMenuHandler | |
| bind: -> | |
| $(document).on 'click', '.group-action-menu a', (e) => | |
| # The following line triggers error: GroupActionMenuHandler.selectMenuItem is not a function | |
| this.selectMenuItem $(e.target).data('id') | |
| false | |
| selectMenuItem: (selectedItem) -> | |
| alert 'hello' |
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
| # # # # # # # ##### ###### # # #### # # | |
| # # ## # # # # # # # ## # # # # # | |
| # # # # # # ## ##### ##### # # # # ###### | |
| # # # # # # ## # # # # # # # # # | |
| # # # ## # # # # # # # ## # # # # | |
| #### # # # # # ##### ###### # # #### # # | |
| Version 5.1.3 Based on the Byte Magazine Unix Benchmark | |
| Multi-CPU version Version 5 revisions by Ian Smith, |
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
| apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make | |
| cd /tmp | |
| wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz | |
| tar xzvf UnixBench5.1.3.tgz | |
| cd UnixBench | |
| ./Run | |
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
| class Feed | |
| fetch: -> | |
| url = "http://example.org/feed?x=1" | |
| url += "&ts=#{@oldest_item}" if @oldest_item | |
| $.getJSON url, (data) -> | |
| @oldest_item = data.oldest_item | |
| # do something else with data | |
| # How can I set a class variable from an anonymous function? For example, @oldest_item on line 4 is always null. |
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
| class Hash | |
| # Returns the value at the specified path. | |
| # For example, [:foo, :bar, :baz] as a path would return the | |
| # value at self[:foo][:bar][:baz]. If self doesn't contain one of | |
| # the keys specified in path, nil is returned. | |
| # | |
| # This method is useful as it simplifies statements such as: | |
| # value = h[:a][:b][:c][:d] if h[:a] && h[:a][:b] && h[:a][:b][:c] | |
| # to | |
| # value = h.value_at_path(:a, :b, :c, :d) |