Skip to content

Instantly share code, notes, and snippets.

View qrush's full-sized avatar
🕸️
Making internets

Nick Quaranto qrush

🕸️
Making internets
View GitHub Profile
When /^(.*) in the "([^\"]*)" section$/ do |action, title|
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
end
When /^(.*) in the "([^\"]*)" row$/ do |action, title|
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@jmlacroix
jmlacroix / aws_cf_invalidate.rb
Created September 21, 2010 03:14 — forked from nbibler/amazon_cloudfront_invalidation.rb
Command line script to invalidate cloudfront objects
require 'rubygems'
require 'hmac-sha1'
require 'net/https'
require 'base64'
s3_access='S3_ACCESS_KEY'
s3_secret='S3_SECRET_KEY'
cf_distribution='CLOUDFRONT_DISTRIBUTION_ID'
if ARGV.length < 1
@copiousfreetime
copiousfreetime / gems-with-md5-mismatches-rubyforge-gemcutter.txt
Created October 28, 2010 06:13
Results of checking rubyforge gems vs. gemcutter gems
AbsoluteRenamer-0.10.1.gem 371603f104b4d3729f78ece9dcfb5510 be03d0cda32d163048ead585a4ebd62f
AbsoluteRenamer-1.0.1.gem 08a38068657b89e3a841e9847b0317fe 6860dbee88f8965a4a7d4cb59ef240f0
AbsoluteRenamer-1.0.2.gem 5a40380cd8a24e948e38007a02464ef5 73befac5423fb40a35e3c677129f1754
Blitz3D-0.1.2.gem 90dbb982a0015ecdb085a5afcb1fa5a1 39a75488879d66a90cc8e4e8ee97e75f
CFPropertyList-2.0.13.gem 2219829a404f1c5764d1c5fedc15bd89 0b5a2d8e3a54efb2da1feb9b1853408c
CFPropertyList-2.0.7.gem 48c2dbcf629eb7a1f9d197e8425f2652 b25980eef1d1bd8ca38e20c75b6466b5
CloudyScripts-0.0.1.gem 792c613c95ec463ee714e502ed52bec7 1f3866fdb9d2c3790a268207509cd1c3
DTAUS-0.2.2.gem 03204c65591ccf91212cda45178d055d 6ceddca756f4c7b506b7cb8e8e4cdd9d
Helipad-0.0.1.gem 1e9f899c816f753b81524f340377d126 f7f23c40bbad7ef47f320ffd83a06cd2
ParseTree-3.0.6.gem 70319854ed60f5d6cdad4c09883407ae 79545a78f5890e34f6f9996b85800a2d
module ActionController
class LogSubscriber < ActiveSupport::LogSubscriber
def start_processing(event)
payload = event.payload
params = payload[:params].except(*INTERNAL_PARAMS)
info " Processing by #{payload[:controller]}##{payload[:action]} as #{payload[:formats].first.to_s.upcase}"
info " Parameters: #{params.inspect}" unless params.empty? || params[:action] == "create"
end
end
@protocool
protocool / caveatPatchor.js
Created February 11, 2011 01:00
Sample Propane caveatPatchor.js file
/**
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
http://propaneapp.com/appcast/Propane.1.1.1.zip
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
@dbgrandi
dbgrandi / hoptoad greasemonkey
Created February 24, 2011 13:33
make hoptoad errors link directly to textmate
// ==UserScript==
// @name Hoptoad Textmate Backtrace
// @namespace hoptoad
// @description Add textmate links to application stacktrace lines on error pages
// @include https://YOURACCOUNT.hoptoadapp.com/errors/*
// ==/UserScript==
//
// based on original script from http://userscripts.org/scripts/show/63465
// with much help from @orta
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA2wxFjUi0j9r+Pggb1xWrZj4n30HrwYQk2HDbAm8SHk+bum016PPSslR+7eveZjDXqhQ4CQSn23JLghNkrYFhnVyWjZelQ50/LWCOBUJZKsUi+fsqJ+55+eU4/BDE78FGR9LH6fMaeDaVowyeH3I5FnAkdpHQvUP3ht8Rs9L3Sm0= evan@vatu.local
1/2 c butter
1 1/4 lb grated sweet potato
2 1/2 T packed brown sugar
1/4 t salt
1/4 c tequila
juice of 2 limes
In a cast iron skillet:
* melt butter
* stir in sweet potatoes, pat into even layer

Currently the RubyGems index is stored as a Gzip file that is a marshalled array. Whenever Bundler needs to install a gem that is not yet installed it downloads the index, gunzips it and unmarshals it. It then looks for dependencies that are described in another file that is also a gzipped and marshalled file. There are several issues that arise from this setup:

  • The full index must be downloaded and parsed, but does not contain dependency data, which must then be downloaded and parsed. This is a relatively time consuming process.
  • The index must be centralized.

Additionally the gems themselves are currently centralized since there is nothing in the meta data that indicates where the gem should be downloaded from. However in order to allow this it is important to find ways of keeping the index from being poisoned (is this an issue in the centralized system?)

Dependency Resolution