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
| // i18n.js | |
| // Copyright 2011 Bradly Feeley | |
| // Language attribute should be added to the html nodes. | |
| // <html lang="en"> | |
| // | |
| // Alternatively, you can set the language by passing an argument to the I18n.set_locale function. | |
| // | |
| // Early in the layout view before all other js: | |
| // <script src="/javascripts/i18n.js" type="text/javascript" charset="utf-8"></script> |
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
| How I Explained REST to My Dad | |
| Sunday, December 12, 2004 | |
| Translations of the following dialog available in Japanese, French, Vietnamese, Italian, Spanish, Portuguese, and Chinese. Huge thanks to YAMAMOTO Yohei, Karl Dubost, jishin, Barbz, Tordek, Edgard Arakaki, keven lw, respectively. If you know of additional translations, please leave a comment with the location. | |
| Dad: Who is Roy Fielding? | |
| Ryan: Some guy. He’s smart. |
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
| from os import curdir, sep | |
| import httplib | |
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| workvar = 0 | |
| # arrvar holds the remaining possible solutions to this block | |
| arrvar = range(999) | |
| globport = 0 | |
| # config vars: | |
| serva8 = "level08-3.stripe-ctf.com" #level8 server |
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
| <?php | |
| // TimThumb script created by Tim McDaniels and Darren Hoyt with tweaks by Ben Gillbanks | |
| // http://code.google.com/p/timthumb/ | |
| // MIT License: http://www.opensource.org/licenses/mit-license.php | |
| /* Parameters allowed: */ | |
| // w: width |
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
| module ActiveRecordSingleton | |
| def self.included(base) | |
| base.class_eval do | |
| class << self | |
| delegate :attributes, :save, :save!, :update_attribute, :update_attributes, :update_attributes!, :update_column, to: 'instance' | |
| [:new, :create, :create!, :destroy, :destroy_all, :delete, :delete_all].each do |method_name| | |
| undef_method method_name | |
| 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
| buffer = '' | |
| cipher = nil | |
| render :text => proc { |response, output| | |
| s3.get(bucket, key_path) do |chunk| | |
| # decrypt chunk | |
| if buffer == '' | |
| # first chunk | |
| buffer << chunk | |
| # extract the magic string and salt | |
| magic_test = buffer.slice!(0..EncryptionHelper.magic_string.length-1) |
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
| e299a5efb88f2049276c6c20626520746865726520696e207468652066696e657374205475657364617920737765617465722120e299a5efb88f |
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
| ruby -e 'puts `curl -s https://gist.githubusercontent.com/bradly/9b0536bd532718a0d22c/raw/d17a2106679a9f4034ba508ef388bf30b23ee54c/gistfile1.txt`.scan(/../).map { |c| c.hex.chr }.join' |
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
| package main | |
| import "fmt" | |
| import "os" | |
| func main() { | |
| source_dir_path := "/some/dir" | |
| destination_dir_path := "/some/other/dir" | |
| ensure_source_directory_exists(source_dir_path) |
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
| require 'uri' | |
| class RootRelativeFilter < HTML::Pipeline::Filter | |
| def call | |
| doc.search("img").each do |img| | |
| next if img['src'].nil? | |
| src = img['src'].strip | |
| if src.start_with? '/' | |
| img["src"] = URI.join(context[:base_url], src).to_s |