Skip to content

Instantly share code, notes, and snippets.

@PetrKaleta
PetrKaleta / Rakefile
Last active August 29, 2015 14:01
Heroku deploy rake tasks with hooks. Demonstrates how to trigger Sidekiq to quiet or terminate via API before deploy
# List of environments and their heroku git remotes (id: 'remote_name')
HEROKU_ENVIRONMENTS = {
staging: 'staging-remote-name',
production: 'production-remote-name'
}
namespace :deploy do
# Create rake tasks to deploy on Heroku environments
# $ rake -T deploy
# rake deploy:production # Deploy to production
@azcoov
azcoov / new.html.haml
Last active June 25, 2019 13:25
Stripe Checkout Form in HAML
= form_tag charges_path do
%article
%label{:class => "amount"}
%span Amount: $5.00
= javascript_include_tag "https://checkout.stripe.com/v2/checkout.js",
:class => "stripe-button",
:"data-key" => "#{Rails.configuration.stripe[:publishable_key]}",
:"data-description" => "30-day free trial",
@xerxesb
xerxesb / gist:1744913
Created February 5, 2012 11:39
Netbank hackery
var BetterNetbank = {
inject: function(table) {
if ($("#" + table).length > 0) {
$('#' + table + ' thead tr').prepend('<th>X</th>');
$('#' + table + 'Body > tr').map(function() {
$(this).prepend('<td><input type="checkbox" /></td>');
});
}
}
}
@runesoerensen
runesoerensen / RequireHttpsAttribute.cs
Created April 12, 2011 16:40
RequireHttpsAttribute using X-Forwarded-Proto header
using System;
using System.Web.Mvc;
using RequireHttpsAttributeBase = System.Web.Mvc.RequireHttpsAttribute;
namespace AppHarbor.Web
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true,
AllowMultiple = false)]
public class RequireHttpsAttribute : RequireHttpsAttributeBase
{