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
* Acerca de Git | |
- ¿Por que es necesario? | |
- Otras opciones en control de versiones | |
- Distribuidos y centralizados | |
* Recursos | |
- Pro Git book. http://git-scm.com/book | |
- StackOverflow | |
- Internet |
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 solution(a) | |
((( a.size + 2 ) * ( a.size + 1 )) / 2) - ( a.reduce(&:+) || 0 ) | |
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
# Missing int from unsorted array and with arbitrary starting int | |
def solution(a=[]) | |
sum = 0 | |
min = a.first | |
max = a.last | |
a.each do |e| | |
sum += e | |
min = e if e < min |
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
# http://stackoverflow.com/questions/28711074/undefined-method-error-for-scope-on-sti-subclass | |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails' | |
gem 'arel' | |
gem 'sqlite3' | |
GEMFILE |
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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', '4.2.0' | |
gem 'arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
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
#/etc/udev/rules.d/99-displaymagic.rules | |
# enable LVDS on HDMI disconnect | |
SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/displaymagic.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
\pset null 'NULL' | |
\set HISTFILE ~/.psql_history- :HOST - :DBNAME | |
\set HISTSIZE 100000 | |
\timing | |
\set PROMPT1 '(%n@%M:%>) [%/] > ' | |
\set PROMPT2 '' | |
\encoding unicode | |
\timing | |
\pset pager always | |
\setenv LESS '-iMSsx2 -FX' |
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
before_filter :find_position, only: [:show, :destroy, :edit] | |
def destroy | |
if @position.destroy | |
flash[:success] = t('labels.success') | |
else | |
flash[:error] = t('labels.error') | |
end | |
redirect_to positions_path | |
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
%s/\(:\)\(\S\+\)\s\+=>/\2:/ |