This file contains 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
module FormtasticExtensions | |
module Formtastic | |
module TextileEditor | |
def self.included(base) | |
base.class_eval do | |
@javascript_included = false | |
end | |
end |
This file contains 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
/** | |
* ## Merging mixin views in backbone.js ## | |
* | |
* really just more a test for tumblr gistr | |
*/ | |
/** | |
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer. | |
**/ | |
function mergeMixin(view, mixin) { |
This file contains 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
// Allows you to specify events on the data tied to the view in the same way | |
// that you can specify dom events: | |
// | |
// dataEvents: { | |
// instanceName: { | |
// 'change:name': 'mothed', | |
// delete: 'otherMethod' | |
// }, ... | |
// } | |
registerDataEvents: function(unbind) { |
This file contains 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
/** | |
Big thanks to Derick Bailey for his post here: | |
http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/ | |
*/ | |
(function(Account) { | |
/** LOTS OF MODEL, COLLECTION, AND VIEW CREATION GOING ON UP HERE, LEFT IT OUT FOR SIMPLICITY */ | |
/** | |
* Define Routing. |
This file contains 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
// I'm developing this now as a part of substance (https://github.com/michael/substance) | |
This file contains 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
:+1: | |
:-1: | |
:airplane: | |
:art: | |
:bear: | |
:beer: | |
:bike: | |
:bomb: | |
:book: | |
:bulb: |
This file contains 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
rewrite ^/sitemap1.xml.gz /sitemaps/$host/sitemap1.xml.gz last; | |
rewrite ^/sitemap_index.xml.gz /sitemaps/$host/sitemap_index.xml.gz last; | |
# or | |
location /sitemap { | |
# it can be already switched on for globally | |
# gzip_static on; | |
rewrite ^/sitemap.xml /sitemaps/$host/sitemap.xml last; # that's will catch .gz files and served as normal static file, but with gzip header |
This file contains 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
namespace :routes do | |
desc "Writes doc/routes.html. Requires Graphviz (dot)" | |
task :visualizer => :environment do | |
File.open(Rails.root.join('doc', 'routes.html'), 'wb') do |f| | |
f.write Rails.application.routes.router.visualizer | |
end | |
end | |
end |
This file contains 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/bin/env ruby | |
# | |
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
# | |
# ## Advisory | |
# | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
# | |
# ## Caveats | |
# |
This file contains 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
# config/initializers/char_converter.rb | |
require 'uri' | |
module Support | |
class CharConverter | |
def initialize(app) | |
@app = app | |
end |