This file contains hidden or 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
#!/bin/sh | |
# The main issues with Ruby 1.8.7 are that it won't build with Clang, | |
# and the Net::HTTPS module won't work with modern versions of OpenSSL. | |
# | |
# This assumes you have already set up homebrew, and run: xcode-select --install | |
#brew install homebrew/dupes/apple-gcc42 | |
#brew install libyaml libffi | |
brew install https://github.com/Homebrew/homebrew-versions/raw/586b7e9012a3ed1f9df6c43d0483c65549349289/openssl098.rb | |
export CC=/usr/local/bin/gcc-4.2 |
This file contains hidden or 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
# from ounce of elixir | |
#https://www.meetup.com/Women-Who-Code-Tampa/events/233014583/ | |
ExUnit.start | |
defmodule CartTest do | |
use ExUnit.Case | |
test "starts with empty count" do | |
assert Cart.count_items([]) == 0 |
This file contains hidden or 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
# coding: utf-8 | |
require 'rubygems' | |
require 'hpricot' | |
require 'fileutils' | |
require 'safe_yaml' | |
require 'time' | |
module JekyllImport | |
# This importer takes a wordpress.xml file, which can be exported from your |
This file contains hidden or 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
class Poet | |
def produce_art(inspiration) | |
"#{inspiration} !" | |
end | |
end | |
class ArtistDecorator < Struct.new(:artist) | |
def produce_art(inspiration) | |
artist.produce_art(inspiration) | |
end |
This file contains hidden or 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
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1>Flight</h1> | |
<h2>Logistics</h2> | |
<table id="logistics"> | |
<tbody> | |
<tr id='time'> |
This file contains hidden or 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
# Even when you create objects they should be properly scoped... Remember this example? | |
t = Tweet.new | |
t.status = "RT #{@tweet.user.name}: #{@tweet.status}" | |
t.original_tweet = @tweet | |
t.user = current_user | |
t.save | |
# A simplified version of this, properly scoped might look like this: |
This file contains hidden or 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 user has many tweets.. and sometimes we want to retweet. | |
class TweetsController < ApplicationController | |
def retweet | |
@tweet = Tweet.find(params[:id]) | |
if @tweet.user == current_user | |
flash[:notice] = "Sorry, you can't retweet your own tweets" | |
elsif @tweet.retweets.where(:user_id => current_user.id).present? |
This file contains hidden or 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
<!-- | |
ATENÇÃO: os links estão ordenados alfabeticamente. Siga esta nomenclatura ao adicionar o seu. | |
--> | |
<h2>#horaextra</h2> | |
<ul id="blogroll"> | |
<li><a href="http://caikesouza.com/?utm_campaign=horaextra">Caike Souza</a></li> | |
<li><a href="http://tapajos.me/?utm_campaign=horaextra">Marcos Tapajós</a></li> | |
<li><a href="http://rafael.adm.br/?utm_campaign=horaextra">Rafael Lima</a></li> | |
<li><a href="http://rafael.tauil.com.br/?utm_campaign=horaextra">Rafael Tauil</a></li> | |
<li><a href="http://ramonpage.com/?utm_campaign=horaextra">Ramon Bispo</a></li> |