Skip to content

Instantly share code, notes, and snippets.

View resistorsoftware's full-sized avatar

David Lazar resistorsoftware

View GitHub Profile
@chriseppstein
chriseppstein / compass.rb
Created January 18, 2011 05:56
The compass configuration file at caring.com
if ENV['RAILS_ENV'] && !defined?(RAILS_ENV)
Object.const_set("RAILS_ENV", ENV['RAILS_ENV'])
end
# Require any additional compass plugins here.
require 'grid-coordinates'
require 'compass-fancybox-plugin'
require 'susy'
project_type = :rails
@foysavas
foysavas / helpers.rb
Created January 31, 2011 18:12
Carrierwave, DataMapper, & Sinatra starring in "Imagine the Possibilities"
def is_ajax_request?
if respond_to? :content_type
if request.xhr?
true
else
false
end
else
false
end
@chriseppstein
chriseppstein / sass_eval.rb
Created February 10, 2011 02:56
Evaluate sass script from standard input and print out the result to standard output.
#!/usr/bin/env ruby
# Make sure to chmod +x this file.
require 'rubygems'
require 'sass'
puts Sass::Script::Parser.parse($stdin.read, 0, 0).perform(Sass::Environment.new)
ls .rvm/gems/ree-1.8.7-2010.02/gems/ | perl -ne 's/(.*)-[.\d]+/$1/; print' | sort | uniq >~/gems
...change to a different ruby...
cat ~/gems | xargs gem install
@max-mapper
max-mapper / index.html
Created March 29, 2011 21:36
js diffing UI
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
/*
Shameless port of a shameless port
@defunkt => @janl => @aq
See http://github.com/defunkt/mustache for more info.

Looking for a free ticket to CodeConf? Well, Shopify is looking for awesome Shopify App Developers! So let’s make something happen. [shopify.com/partners]

Using the Shopify API, create a product on the *Cronin, Feest, and Kutch* store and include your contact info in the product description. The product can be whatever you want, so go nuts! The most awesome product, as decided by our whims, wins!

*Products must be created by 11:59pm EDT, Tuesday April 5th 2011.* Winners will be announced the next day.

Looking for a free conference ticket to JSConf 2011 in beautiful Portland, OR USA? Well, Shopify is looking for awesome Shopify App Developers! So let’s make something happen. [shopify.com/partners]

Using the Shopify API, solve the following puzzle, follow @shopifyapi, and send the answer to [email protected]

My Aunt Ruth’s birthday is coming up, and I’d like to get her her favourite candy.

@madrobby
madrobby / everytimezone.coffee
Created April 17, 2011 13:36
First conversion of http://everytimezone.com/ JavaScript code to CoffeeScript
# Two things are important to note:
#
# 1) The code is fugly, because it was a JavaScript/iPad experiment.
# I know that it is ugly, so pretty please don't comment on that part.
# 2) I tried to use as many CoffeeScript features as possible,
# including but not limited to list comprehensions,
# heredocs, destructuring assignment and also the "do" operator
#
# I welcome comments about stuff that is not CoffeeScripty enough, or what I should
# write differently.
@jed
jed / LICENSE.txt
Created May 10, 2011 16:04 — forked from 140bytes/LICENSE.txt
write contextual templates
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@resistorsoftware
resistorsoftware / ShopifyAPICallLimit.rb
Created May 14, 2011 16:01 — forked from christocracy/ShopifyAPICallLimit.rb
Hacking ActiveResource::Connection for Shopify API in order to read HTTP response header 'http_x_shopify_api_call_limit'. Simply require this code after your gems have been loaded.
class ActiveResource::Connection
# HACK 1: Add an attr_reader for response
attr_reader :response
def request(method, path, *arguments)
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
payload[:method] = method
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
payload[:result] = http.send(method, path, *arguments)
end