This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Try 1 | |
# How could I get the following working nicely | |
Date.strptime("Ven 13 Mai. 2011, 16h00", "%a %d %b %Y, %Hh%M") | |
# I've tried to update Date::ABBR_DAYNAMES as follow | |
I18n.locale = :fr | |
Date::ABBR_DAYNAMES = I18n.t('date.abbr_day_names') | |
Date::ABBR_MONTHNAMES = I18n.t('date.abbr_month_names') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#horizontal-centered-menu { | |
float:left; | |
width:100%; | |
overflow:hidden; | |
position:relative; | |
ul { | |
clear:left; | |
float:left; | |
list-style:none; | |
position:relative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open terminal.app | |
2. Paste this command: defaults write NSGlobalDomain WebKitDeveloperExtras -bool true | |
(credit: https://twitter.com/defaultswrite/status/220164244954554368) | |
3. Open Rdio.app | |
4. Right click and show the inspector panel | |
5. In the console section, paste this line: $("head").append('<link href="https://s3.amazonaws.com/simon-dev/css/rdio.css" rel="stylesheet" type="text/css">') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load the macvim version of terminal vim | |
if which mvim &> /dev/null; then | |
alias vim='mvim -v' | |
fi | |
alias v='vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Extensions | |
module Translatable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def translations(*fields) | |
fields.each do |field| | |
define_method field do read_translate(field) end | |
define_method "#{field}=" do |value| write_translate(field, value) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'test_string'.upcase | |
#=> "TEST_STRING" | |
'test_string'.upcase! | |
#=> "TEST_STRING" | |
'TEST_STRING'.upcase | |
#=> "TEST_STRING" | |
'TEST_STRING'.upcase! | |
#=> nil |
by
Simon Prévost, Développeur Web chez Mirego
(The slides were made for mdp)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyProject.Plugs.RateLimting do | |
import Plug.Conn | |
alias Exredis.Api, as: Redis | |
@ttl 60 # seconds | |
@limit 5 # requests count | |
@header_limit "x-rate-limit-limit" | |
@header_remaining "x-rate-limit-remaining" | |
@header_reset "x-rate-limit-reset" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GeneratePlaceholders do | |
import Ecto.Query | |
alias Accent.Repo | |
@regex Langue.Formatter.Rails.placeholder_regex() | |
@document_id "85f15c8e-a5bb-4235-b04f-3ce04e672749" | |
def update_operations do | |
operations() |