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
| 0x4217B17690dde35C7eC02D0b5FCcF153a997C996 |
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
| @ExampleComponent = React.createClass | |
| mixins: [HistoryJSMixin] | |
| # so, in your search field, you can save the state to history and set the URL as well below... | |
| # | |
| search: (toSearch)-> | |
| handleResults = (err, content)=> | |
| if content.query == @state.search | |
| @setState(searchResults: content.hits) | |
| @saveState(url: '/foo?bar=foo') # BINGO |
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
| /** Adapted from http://leifdenby.svbtle.com/reactjs-and-browser-history-a-historyjs-mixin */ | |
| var HistoryJSMixin = { | |
| _historyjs_recoverState: function(state) { | |
| received_state_serialized = state.data; | |
| if (!$.isEmptyObject(received_state_serialized)) { | |
| if (this.deserializeState !== undefined) { | |
| received_state = this.deserializeState(received_state_serialized); | |
| } | |
| else { |
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
| # LazyGenerate makes it easy to make new ActiveRecord objects with accessors | |
| # that are generated and saved lazily | |
| # | |
| # To use, add this to your ActiveRecord class: | |
| # extend LazyGenerate | |
| # lazy_generate :my_lazy_property, :generate_lazy_property | |
| # | |
| # Side effect: Save is called on the object upon generation. | |
| # | |
| module LazyGenerate |
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
| 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
| Delivered-To: garry@posterous-inc.com | |
| Received: by 10.14.37.77 with SMTP id x53cs147624eea; | |
| Mon, 9 Aug 2010 13:51:03 -0700 (PDT) | |
| Received: by 10.142.135.21 with SMTP id i21mr8948493wfd.92.1281387061871; | |
| Mon, 09 Aug 2010 13:51:01 -0700 (PDT) | |
| Return-Path: <press+bncCOC9uMyMHRC01IHjBBoEnnh3wg@posterous-inc.com> | |
| Received: from mail-pz0-f70.google.com (mail-pz0-f70.google.com [209.85.210.70]) | |
| by mx.google.com with ESMTP id n6si13404264wfg.99.2010.08.09.13.51.00; | |
| Mon, 09 Aug 2010 13:51:01 -0700 (PDT) |
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/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_request_handler.rb:329:in `install_useful_signal_handlers' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:515:in `call' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:515:in `write' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:515:in `print' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:515:in `send_to_db' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:376:in `remove_from_db' /usr/local/lib/ruby/1.8/mutex_m.rb:67:in `synchronize' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:551:in `_synchronize' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/db.rb:375:in `remove_from_db' /vendor/gems/mongodb-mongo-0.14.1/lib/mongo/collection.rb:209:in `remove' /app/models/post.rb:234:in `delete_meta_data' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.3/lib/active_support/callbacks.rb:178:in `send' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.3/lib/active_support/callbacks.rb:17 |
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
| abcccd |
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 !use_javascript | |
| body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do | |
| github_url = $1 | |
| begin | |
| SystemTimer.timeout(5) do | |
| (Hpricot.new(open(github_url).read) % 'div.data').to_html | |
| end | |
| rescue Timeout::Error => detail | |
| logger.debug(e) | |
| %Q[<p><a href="#{github_url}">github_url</a></p>] |
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 gist |
NewerOlder