Skip to content

Instantly share code, notes, and snippets.

View iRyusa's full-sized avatar

Maxime Brazeilles iRyusa

  • Dernier Cri
  • Lille, France
View GitHub Profile
@iRyusa
iRyusa / layout.haml
Created May 22, 2013 12:21
Snippet for missing translation highlight in RAILS layout
- if Rails.env.development?
:css
.translation_missing{
color: red;
}
@robink
robink / Gemfile
Last active December 17, 2015 06:58
Show the "changelog" / "releases notes" of a given repo. Relies on Pull Requests descriptions (as they are editables) and printing only when their title contains "#changelog".
source 'https://rubygems.org'
gem "github_api"
gem "highline"
@ryanb
ryanb / abilities.rb
Created September 15, 2012 19:23
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end
@rchampourlier
rchampourlier / google_bot_aware.rb
Created May 3, 2012 22:32
Rack middleware to make Rails deal correctly with GoogleBot's '*/*;q=0.6' Accept header
# This Rack middleware helps solving the issue with some Rails versions which do not accept
# a '*/*;q=0.6' and their variants 'Accept' request header. This header is particularly used
# by Google Bot, and if Rails doesn't like it, it will return a 500 or 406 error to Google Bot,
# which is not the best way to get your pages indexed.
#
# References:
# - http://stackoverflow.com/questions/8881756/googlebot-receiving-missing-template-error-for-an-existing-template
# - https://github.com/rails/rails/issues/4127
#
class GoogleBotAware
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@mirisuzanne
mirisuzanne / input-placeholder.sass
Created April 16, 2011 22:56
styling placeholder text
// Mixins ---------------------------------------------------------------
=placeholder-style
color: #777
// add your defaults here.
// if you need more than one style-group you can either create several mixins,
// or just name the style-groups and take a single style-group-name argument.
=apply-placeholders
&::-webkit-input-placeholder