Skip to content

Instantly share code, notes, and snippets.

View denisjacquemin's full-sized avatar
🎯
Focusing

Denis Jacquemin denisjacquemin

🎯
Focusing
View GitHub Profile
@skorianez
skorianez / gist:1308103
Created October 24, 2011 00:06
JCrop + Carrierwave
# https://github.com/gzigzigzeo/carrierwave-meta
# Integrating CarrierWave with JCrop
# Let implement the behavior like at this demo: deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail
# The uploader:
class CropUploader < SobakaUploader
include CarrierWave::Meta
# Crop source is a source image converted from original which could be bigger than source area (left image in the example).
version :crop_source do
anonymous
anonymous / application_controller.rb
Created May 30, 2011 21:14
Patching render to disable the layout if PJAX request
class ApplicationController < ActionController::Base
...
#We don't want to render the layout if PJAX is working
def render(options = nil, extra_options = {}, &block)
if request.headers['X-PJAX'] == 'true'
options = {} if options.nil?
options[:layout] = false
end
super(options, extra_options, &block)
end
@madrobby
madrobby / LICENSE.txt
Created May 18, 2011 13:50 — forked from 140bytes/LICENSE.txt
Credit card detection
Copyright (c) 2011 Thomas Fuchs, http://mir.aculo.us/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@ryansch
ryansch / hooks_controller.rb
Created September 28, 2010 15:03
Rails Controller for Chargify Webhooks
require 'md5'
class Chargify::HooksController < ApplicationController
protect_from_forgery :except => :dispatch
before_filter :verify, :only => :dispatch
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze
def dispatch
event = params[:event]