# Run the hello game:
python hello_game.py
# Run the hello and bye game:
python hello_and_bye_game.py
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
# ... | |
# Add these lines at the end of your ~/.bash_profile | |
# Git functions (used to define a custom prompt) | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
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
# Provide autocompletion for a Makefile targets. | |
# | |
# Usage: | |
# source .bash_completion # this file | |
# make[tab] # autocompletes the .PHONY targets :) | |
# | |
# See https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2 | |
_make() | |
{ | |
local cur prev opts |
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
--- | |
layout: nil | |
--- | |
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text" xml:lang="en">{{ site.root_desc }}</title> | |
<link type="application/atom+xml" href="http://paulstamatiou.com/feed/" rel="self"/> | |
<link type="text" href="http://paulstamatiou.com" rel="alternate"/> | |
<updated>{{ site.time | date_to_xmlschema }}</updated> |
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
# lib/custom_form_builder.rb | |
# See https://github.com/plataformatec/simple_form#custom-form-builder | |
class CustomFormBuilder < SimpleForm::FormBuilder | |
def input(attribute_name, options = {}, &block) | |
if options[:wrapper_html] | |
options[:wrapper_html].merge! class: 'form-group' | |
else | |
options[:wrapper_html] = { class: 'form-group' } | |
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
# encoding: utf-8 | |
# lib/tbk/webpay/logger.rb | |
# Copyright (c) 2013 Acid Ltda <www.acid.cl> | |
# Copyright (c) 2013 Gonzalo Bulnes Guilpain <gonzalo@acid.cl> | |
# Copyright (c) 2013 Cristián Carreño <kiel@acid.cl> | |
# | |
# This code is distributed under the same license than TBK-Rails, | |
# see https://github.com/kiel-cristian/tbk-rails for details. | |
module TBK |
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 in rails via: | |
# config/initializers/core_extensions.rb | |
#Forcibly require our core extensions after rails has loaded | |
Dir.glob(Rails.root.join('lib', 'core_ext', '*.rb')).each { |extension| require extension } |
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
require 'spec_helper' | |
describe WorkPlace do | |
# This is the simplest (best) way to test a dependent: :destroy option | |
it "has one address and ensures it's destroyed when destroyed itself" do | |
should have_one(:address).dependent(:destroy) | |
end | |
# ... however the use this example does of lambda {} to encapsulate the code |
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
es: | |
errors: | |
messages: | |
not_found: "no encontrado" | |
already_confirmed: "ya ha sido confirmado" | |
not_locked: "no está bloqueado" | |
devise: | |
sessions: | |
link: 'Ingresar' |
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
# acid-template.rb | |
git :init | |
gitignore = run("curl https://gist.github.com/raw/3875160/5d2745ee9bcae0bb4addf4bc701d3fa9a48ce187/.gitignore") | |
file ".gitignore", gitignore | |
if yes?("Do you use RVM? (yes|no") | |
if yes?("Do you want to create a .rvmrc file for the project? (yes|no)") | |
# RVM | |
current_ruby = %x{rvm list}.match(/^=>\s+(.*)\s\[/)[1].strip | |
desired_ruby = ask("Which RVM Ruby would you like to use? [#{current_ruby}]") |