Skip to content

Instantly share code, notes, and snippets.

View tijmenb's full-sized avatar

Tijmen Brommet tijmenb

  • CaptionHub
  • Amsterdam, NL
  • 00:03 (UTC +02:00)
View GitHub Profile
@tijmenb
tijmenb / awesome.css
Created May 5, 2011 13:29
CSS buttons
/** awesome css buttons: http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba **/
.awesome, .awesome:visited {
background: #222 url(/img/alert-overlay.png) repeat-x;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
@tijmenb
tijmenb / Capfile
Created October 1, 2011 00:44
Color for Capistrano
require 'color-logger.rb'
@tijmenb
tijmenb / gist:2360303
Created April 11, 2012 16:15
Compare a bunch of images to find duplicates
files = Dir.glob("*.png")
compares = {}
files.each do |file|
files.each do |compare_to|
key = [file, compare_to].sort.join("-")
unless compares[key] || file == compare_to
compares[key] = `compare -metric MAE #{file} #{compare_to} null: 2>&1`
puts "#{file} vs #{compare_to} = " + compares[key] # if a comparison yields `0 (0)`, they're the same
end
end
@tijmenb
tijmenb / rails.validations.formtastic.bootstrap.js
Created February 14, 2013 10:15
Bootstrap + Formtastic + client side validations
/*
Client Side Validations + Formtastic + Bootstrap
based on: https://github.com/dockyard/client_side_validations-formtastic
*/
(function() {
@tijmenb
tijmenb / gist:5052074
Last active December 14, 2015 07:39
Fix Draper / Kaminari conflict `undefined method `current_page' for #<Draper::CollectionDecorator:>`
module Draper
class CollectionDecorator
delegate :current_page, :total_pages, :limit_value
end
end
@tijmenb
tijmenb / devise.nl.yml
Last active December 17, 2015 07:49 — forked from Daan-/devise.nl.yml
Devise translation in Nederlands van https://gist.github.com/Daan-/1559647, maar dan vousvoyerend, want we kennen elkaar nog niet zo goed en Rails is beleefd.
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
nl:
errors:
messages:
expired: "is verlopen, vraag een nieuwe aan"
not_found: "niet gevonden"
already_confirmed: "is reeds bevestigd"
not_locked: "is niet gesloten"
not_saved:
@tijmenb
tijmenb / countries.json
Last active December 17, 2015 08:48
Country codes for all locations supported by Facebook, for use in a tab app. Stolen from http://www.codingcolor.com/as3/facebook-country-list/
[{"value": "AF", "label": "AFGHANISTAN"},
{"value": "AL", "label": "ALBANIA"},
{"value": "AR", "label": "ARGENTINA"},
{"value": "AM", "label": "ARMENIA"},
{"value": "AZ", "label": "AZERBAIJAN"},
{"value": "BY", "label": "BELARUS"},
{"value": "BE", "label": "BELGIUM"},
{"value": "BO", "label": "BOLIVIA, PLURINATIONAL STATE OF"},
{"value": "BA", "label": "BOSNIA AND HERZEGOVINA"},
{"value": "BR", "label": "BRAZIL"},
@tijmenb
tijmenb / gist:b3dd9284719124da453d
Created August 19, 2014 15:02
S3 bucket policy
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListBucketMultipartUploads"
],
"Resource": "arn:aws:s3:::BUCKETNAME",
@tijmenb
tijmenb / Gemfile
Created February 19, 2016 13:47
Download tags
source 'https://rubygems.org'
gem 'http'
#!/bin/bash
set -ex
bundle_update_for_repo() {
git clone git@github.com:alphagov/$1.git --depth=1
cd $1
git checkout -b "update-dependencies-$(date +"%Y-%m-%d")"
BUNDLE_UPDATE_LOG="$(bundle update --jobs=4 | grep was)"