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
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 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
pastie was soo 2007 |
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
e299a5efb88f2049276c6c20626520746865726520696e207468652066696e657374205475657364617920737765617465722120e299a5efb88f |
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
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 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 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 |
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 | |
spec = Gem::Specification.new do |s| | |
s.name = %q{event_calendar_engine} | |
s.version = "0.2.15" | |
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | |
s.authors = ["Jason LaPier", "Jeremiah Heller"] | |
s.date = %q{2011-09-09} | |
s.description = %q{Provides basic event management features with versioned history of changes.} |
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
› cd ~/code | |
2.0.0-p481 in code/ | |
› ember new wheres-waldo | |
Future versions of Ember CLI will not support v0.10.30. Please update to Node 0.12 or io.js. | |
version: 0.2.2 | |
Could not find watchman, falling back to NodeWatcher for file system events. | |
Visit http://www.ember-cli.com/#watchman for more info. | |
installing | |
create .bowerrc |
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
# by bryan helmkamp with slight modification by chris wanstrath | |
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow | |
module GitCommands | |
extend self | |
def diff_staging | |
`git fetch` | |
puts `git diff origin/production origin/staging` | |
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
- fields_for "profile[contact_attributes][]", contact do |c| | |
%label{:for => 'contact_first_name'} First Name | |
= c.text_field :first_name, :size => 25 | |
%br | |
%label{:for => 'contact_last_name'} Last Name | |
= c.text_field :last_name, :size => 25 | |
%br | |
%label{:for => 'contact_email'} Email Address | |
= c.text_field :email, :size => 25 | |
%br |
OlderNewer