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) |
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
## | |
## TAKEN FROM https://raw.github.com/benhoskings/delayed_job/c3a28f9714568c887271e492dd8c6710965278e8/lib/delayed/yaml_ext.rb | |
## Solves problems serializing strategies to yaml | |
## | |
# These extensions allow properly serializing and autoloading of | |
# Classes, Modules and Structs | |
require 'yaml' | |
class Module |
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
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644: [BUG] Segmentation fault | |
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux] | |
-- control frame ---------- | |
c:0049 p:---- s:0258 b:0258 l:000257 d:000257 CFUNC :initialize | |
c:0048 p:---- s:0256 b:0256 l:000255 d:000255 CFUNC :open | |
c:0047 p:0029 s:0251 b:0251 l:0018d0 d:000250 BLOCK /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644 | |
c:0046 p:0031 s:0249 b:0249 l:000248 d:000248 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:44 | |
c:0045 p:0026 s:0237 b:0237 l:000236 d:000236 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:87 | |
c:0044 p:0038 s:0231 b:0231 l:0018d0 d:0018d0 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644 |
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
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:194: [BUG] Segmentation fault | |
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux] | |
-- control frame ---------- | |
c:0027 p:---- s:0111 b:0111 l:000110 d:000110 CFUNC :gets | |
c:0026 p:0015 s:0107 b:0107 l:000106 d:000106 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:194 | |
c:0025 p:0011 s:0103 b:0103 l:000102 d:000102 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:200 | |
c:0024 p:0013 s:0096 b:0096 l:000095 d:000095 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:215 | |
c:0023 p:0169 s:0089 b:0087 l:000086 d:000086 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:100 | |
c:0022 p:0026 s:0083 b:0083 l:000082 d:000082 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanst |