Skip to content

Instantly share code, notes, and snippets.

protect_from_forgery
include Hobo::Controller::AuthenticationSupport
before_filter :except => [:login, :forgot_password, :accept_invitation, :do_accept_invitation, :reset_password] do
login_required unless User.count == 0
end
@keo
keo / post-receive.sh
Created May 4, 2011 14:21
git deploy hook
#!/bin/sh
# super-duper post-receive hook
# (c) 2011 Barnabas Debreczeni <[email protected]>
DEPLOY_TO=/webapps/cms
umask 002
echo "++++++++++++++++++++++++++++++++++++++++++++ deploying to $DEPLOY_TO"
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR APP ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
ssh-dss AAAAB3NzaC1kc3MAAACBAKuvrrvbl3xlSrLMxN2+ow7/tvtMfLLbzxMsCNcGRzeit/rsnRD94etOFpw/3N1zqsUOQxXiiTGZkntyjnPdELUDhC/I9CuN8ZgbRVhX3AOAYXtrUrLqze+kha20Pt3z9s6kyWtG6FwNGtoQ1TKIPJgZ2L4IG7XHheoUDiRD8/mvAAAAFQC3+aDMPgfMv0W05XNdWj/M/iMfUQAAAIB9Zg90B6BybIjJGo0db0SNGWxE802jJ/wIlK2wJ3+4q3dAKA+YZAN5kiv8c/qv9T1Bbo3VB+i+ojmmZqhhzXMv20w8V+zWvKkHIoWkGJLdEfYq40z/h92bBiF60GKRU34F0xcWPdDrZ9sZ3A8hoLni2eacm85MhR47O55oVIA/dAAAAIAN8vW79O9Cj67w+HUJ2T1Y0MZnBVrJmBwJ9dlghzAEQBp27nvu+9W8hIaxcVm4ShvJ+2SPvHmIHqObKKGP7C6Ze6eznixKGnwGiesPph1ixUwkgVCRjtInQazgzqwG47VafQ6kinKUyOWEtkOwXsYij445zguQQHksKMei5fN2Ww== /Users/keo/.ssh/id_dsa
SELECT people.*
FROM `people`
INNER JOIN
`people_sections` ON `people`.`id` = `people_sections`.`person_id` AND `people_sections`.`deleted_at` IS NULL
INNER JOIN `event_types` ON `event_types`.`section_id` = `people_sections`.`section_id` AND `event_types`.`deleted_at` IS NULL
INNER JOIN `events` ON `events`.`event_type_id` = `event_types`.`id` AND `events`.`competition_id` = 16777237 AND `events`.`deleted_at` IS NULL
WHERE
`people`.`deleted_at` IS NULL
AND (`people`.`country_id` = 16777217)
GROUP BY `people`.`id`
@keo
keo / fogbugz_beautifier.tamper.js
Created September 20, 2011 10:58
FogBugz Kanban board beautifier
// ==UserScript==
// @name FogBugz Kanban beautifier
// @namespace http://divinemedia.com/
// @version 0.4
// @description Make FogBugz Kanban board status display friendly
// @include http://*/*
// @match https://*.fogbugz.com/default.asp?pg=pgPlugin&[email protected]
// @copyright 2011+, Barnabas Debreczeni ([email protected])
// ==/UserScript==
@keo
keo / resque_mock.rb
Created February 19, 2012 08:25
Simple mocking for Resque
require 'resque'
module Resque
def self.mock!
puts "*** Mocking Resque" if ENV['VERBOSE']
extend MockExt
@jobs = []
end
module MockExt
@keo
keo / teamcity_github_status.rb
Created October 29, 2012 10:30
Post TeamCity build status to GitHub
#!/usr/bin/env ruby
require 'bundler/setup'
require 'rest-client'
require 'json'
teamcity_url = ENV['TEAMCITY_URL']
build_num = ENV['BUILD_NUMBER']
build_type = ENV['BUILD_TYPE']
github_token = ENV['GITHUB_TOKEN']
# Re-create steps:
$ gem install json -v 1.5.5
$ gem install gherkin -v 2.11.5
$ gem install veewee
# Or simply create a Gemfile to solve dependency problems.
# Then build the box:
@keo
keo / bootstrap.sh
Last active January 25, 2024 15:49
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup