Skip to content

Instantly share code, notes, and snippets.

View swrobel's full-sized avatar

Stefan Wrobel swrobel

View GitHub Profile
# if you look in clearance/lib/clearance/user.rb you can see the encryption method
#
# def encrypt(string)
# generate_hash("--#{salt}--#{string}--")
# end
#
# lib/clearance_crypto.rb
class ClearanceCrypto
def self.encrypt(*tokens)
Digest::SHA1.hexdigest("--#{tokens[1]}--#{tokens[0]}--")
@ledermann
ledermann / .gitignore
Created May 20, 2011 16:54 — forked from trevorturk/cache_assets.rake
rake deploy and rake cache_assets for Heroku (storing JS minimized and gzipped on Amazon S3)
# Add this
public/javascripts/all.js
@ehoch
ehoch / gist:1960548
Created March 2, 2012 19:17
Puma / DJ Procefile on Heroku
web: bundle exec puma -p $PORT
worker: bundle exec rake jobs:work
@ehoch
ehoch / Full Site SSL.md
Last active December 11, 2015 17:49
Full Site SSL in Spree

Curious how Alarm Grid went full site-wide SSL using Spree? Just create the one decorator below and you're good to go!

Note: This gist will not redirect .xml files so that our feeds do not error out on iPhones which do not support RSS feeds in https.

@Maux
Maux / index.html
Created November 28, 2012 16:01
A CodePen by Maux Webmaster. Another Responsive Slider with CSS3 without JS - Another Responsive Slider with CSS3 without JS Inspired by 'CSScience'. Original creation by Ian Hansson. --- (https://twitter.com/teapoted) Example Page: --- (http://csscien
<div class="content">
<h1>Another Responsive Slider with CSS3 without JS</h1>
<input type="radio" id="slide1" name="slider" checked>
<input type="radio" id="slide2" name="slider">
<input type="radio" id="slide3" name="slider">
<input type="radio" id="slide4" name="slider">
<input type="radio" id="slide5" name="slider">
<div class="slides">
<div class="overflow">
<div class="inner">
@zefer
zefer / copy-s3-bucket.rb
Created April 4, 2011 11:24
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)
@neddenriep
neddenriep / gist:8484466
Created January 18, 2014 00:46
Add Google Tag Manager to Spree _google_analytics
<script>
dataLayer = [];
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-NF7JL2"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
# Rack middleware that drops non properly encoded cookies that would hurt the ActionDispatch::Cookies middleware.
#
# This is actually a hotfix for issues
# * https://github.com/rack/rack/issues/225
# * https://github.com/rails/rails/issues/2622
module CleanCookies
# Tests whether a string may be decoded as a form component
def decodable?(string)
URI.decode_www_form_component(string)
true
@iwinux
iwinux / gist:1529093
Created December 28, 2011 18:38
config.assets.precompile
def compile_asset?(path)
# ignores any filename that begins with '_' (e.g. sass partials)
# all other css/js/sass/image files are processed
if File.basename(path) =~ /^[^_].*\.\w+$/
puts "Compiling: #{path}"
true
else
puts "Ignoring: #{path}"
false
end
@dogoku
dogoku / A README.md
Last active December 29, 2022 02:58 — forked from tiffon/Find Results.hidden-tmLanguage
Search result syntax highlighting for Sublime Text

#ST2/3 Search result syntax highlighting

##Introduction and disclaimer

This is gist contains an edited Find Results.hidden-tmLanguage which adds syntax highlighting to your ST search results. As far as I know, there is no plugin that does this and for that reason it needs to be done via config.

DISCLAIMER: Use this HACK at your risk and backup the original files you are about to mess with.

##Usage Guide for Sublime Text 2