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
# Run with: rake environment elasticsearch:reindex | |
# Begins by creating the index using tire:import command. This will create the "official" index name, e.g. "person" each time. | |
# Then we rename it to, e.g. "person20121001" and alias "person" to it. | |
namespace :elasticsearch do | |
desc "re-index elasticsearch" | |
task :reindex => :environment do | |
klasses = [Place, Person, Caption] |
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
# ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like | |
# :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. | |
# # If you have any extra navigational formats, like :iphone or :mobile, you | |
# should add them to the navigational formats lists. # | |
# The :"*/*" and "*/*" formats below is required to match Internet # Explorer requests. | |
# config.navigational_formats = [:"*/*", "*/*", :html] config.navigational_formats = [:"*/*", "*/*", :html, :json] |
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 Everyone: | |
To ensure that we have a smooth recording session and good audio quality we have prepared a few recording tips. | |
Tips for improving your Audio Quality. | |
Please check the following: | |
* The Killer App: Most important thing is to turn off Skype, MSN, Spotify, any other peer-to-peer/file-sharing apps, online games and video downloads ... basically anything that could suck giant wads of bandwidth. |
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 test_feedburner_aliased | |
series = Series.create title: 'foo', url: 'http://feeds.feedburner.com/InTheBleachersPodcast' | |
assert_not_nil Series.find_by_url('http://feeds.feedburner.com/inthebleacherspodcast') | |
assert_not_nil Series.find_by_url('http://feeds.feedburner.com/inthebleacherspodcast/') | |
assert_not_nil Series.find_by_url('http://feeds.feedburner.com/inthebleacherspodcast.xml') | |
assert_not_nil Series.find_by_url('http://feeds.feedburner.com/inthebleacherspodcast?format=rss') | |
assert_not_nil Series.find_by_url('http://feeds2.feedburner.com/inthebleacherspodcast?format=rss') | |
assert_not_nil (series = Series.find_by_url('http://feeds.feedburner.com/InTheBleachersPodcast')) | |
assert_equal 'http://feeds.feedburner.com/inthebleacherspodcast', series.url |
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
/** | |
* Overwrites default Mousetrap.bind method to optionally accept | |
* an object to bind multiple key events in a single call | |
* | |
* You can pass it in like: | |
* | |
* Mousetrap.bind({ | |
* 'a': function() { console.log('a'); }, | |
* 'b': function() { console.log('b'); } | |
* }); |
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
# Monkey-patch stopCallback so that Mousetrap will ignore any keyboard action during modal | |
((originalStopCallback) -> Mousetrap.stopCallback = -> | |
return true if $('body.modal-open').length | |
originalStopCallback.apply(Mousetrap, arguments) | |
)(Mousetrap.stopCallback) | |
# "?" key will produce keyboard shortcuts dialog (as on Twitter and GitHub) | |
# It fetches the dialog content on demand for performance reasons | |
Mousetrap.bind '?', -> | |
$.get '/docs/keyboard_shortcuts', (html) -> |
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
index 3a9730c..d3f1a17 100755 | |
--- a/vendor/assets/javascripts/jquery.touchcarousel-1.1.js | |
+++ b/vendor/assets/javascripts/jquery.touchcarousel-1.1.js | |
@@ -981,6 +981,9 @@ | |
if(this.settings.scrollbarAutoHide) { | |
this._hideScrollbar(); | |
} | |
+ if(this.settings.onClick !== null) { | |
+ this.settings.onClick.call(this, e); | |
+ } |
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 String | |
def titleize | |
self.split(/\s+/).map{|word| word.slice(0,1).capitalize + word.slice(1..-1)}.join(' ') | |
end | |
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
Does CloudFlare Honor If-None-Match Header (ETags passed in the request)? | |
I've observed that a basic call (with no ETag or timestamp) will yield a 304 from my server to Cloudflare, but then Cloudflare passes it back to the client as a 200 with no ETag field. | |
And if the client does include an ETag in the request (using If-None-Match header), Cloudflare simply doesn't honor it AFAICT. It still passes the call through to my server, which yields 304, and then responds with a 200 response. | |
I may have the wrong expectation from a CDN, but I thought it would be able to issue 304 and not access my server if the correct ETag is passed in. |
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 Channel < ActiveRecord::Base | |
include Tire::Model::Search | |
# Let's *NOT* include Tire's default callbacks ... | |
### include Tire::Model::Callbacks | |
# ... and instead handle them ourselves | |
after_save :search_index | |
after_destroy :search_index |