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
dep 'h', :path do | |
met? { | |
path.p.tapp.exists? | |
} | |
meet { | |
# install with apt | |
} | |
end | |
dep 'headers' do |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
def some_action | |
redirect_to wizard_path_for(@intervention) | |
end | |
def wizard_path_for(intervention) | |
case intervention.wizard | |
when 100 | |
intervention_expiries_path(intervention) | |
when 80 | |
intervention_clients_path(intervention) |
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
# Bad because the dependency on ModelClass and ApiClass are hard-coded | |
module HitTheApi | |
def self.go | |
ids_to_update = ModelClass.what_ids_should_I_update | |
ids_to_update.each do |id| | |
data = ApiClass.fetch_me_data(id) | |
ModelClass.persist_data(id, data) | |
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
# One thing to add: | |
# * action_has_layout? method (if you have one, combine them) | |
# | |
class ApplicationController < ActionController::Base | |
# ... | |
private | |
def action_has_layout? | |
!request.xhr? && super |
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
# dynamic removal of a dep requirement, | |
# based on a condition evaluated after previous requires have been processed | |
dep 'site' do | |
requires [ | |
'system', | |
'account', | |
'site dir', | |
'site options' | |
] |
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
git config --global alias.lg "log --graph --since='1 week ago' --pretty=format:'%Cblue%h%Creset %cr %Cgreen%an%Creset %s'" |
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
def value_for_label object, method | |
(object && object.send(method)) || "-" | |
end | |
def conditions_map_for conditions | |
{ | |
:dp_c => 'Dew point', | |
:rh => 'Relative humidity', | |
:feels_like_c => 'feels like', | |
:wind_dir_and_speed => 'Wind', |
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
________ __ ___ __ __ | |
/ ____/ /__ ____ / |/ /___ _____/ /___/ /__ _________ | |
/ / __/ / _ \/ __ \ / /|_/ / __ `/ __ / __ / _ \/ ___/ __ \ | |
/ /_/ / / __/ / / / / / / / /_/ / /_/ / /_/ / __/ / / / / / | |
\____/_/\___/_/ /_/ /_/ /_/\__,_/\__,_/\__,_/\___/_/ /_/ /_/ | |
__ __ __ __ __ | |
/ \ |__| _) _) /| /| (__) | / \ | | |
\__/ | /__ __) | | (__) |___ \__/ |___ |
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
%a{{:href => name},{:class => ('selected' if @category == name)}} | |
%span= name |
NewerOlder