Skip to content

Instantly share code, notes, and snippets.

View lucasmartins's full-sized avatar
🤘

Lucas Neves Martins lucasmartins

🤘
View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@rcrowley
rcrowley / multio.rb
Created July 28, 2010 06:15
Ruby IO multiplexer
# MultIO Ruby IO multiplexer
# http://rcrowley.org/2010/07/27/multio-ruby-io-multiplexer.html
require 'stringio'
class MultIO < Array
def <<(io)
if io.respond_to?(:to_str)
io = StringIO.new(io)
@mislav
mislav / index.haml
Created March 21, 2011 15:00
How to render Haml, Erb templates with a layout
%h1&= title
%p Hello world
@samqiu
samqiu / nginx.conf
Created September 15, 2011 01:07 — forked from huacnlee/nginx.conf
Nginx http proxy cache to mirror of Rubygems.org
# 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度
# 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装
# 做这个起什么作用?
# rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。
# 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外
proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m
inactive=24h max_size=1g;
server {
listen 80;
@dkubb
dkubb / .gitignore
Created December 5, 2011 18:26
Test Feedzirra w/VCR using an HTTP proxy
cassettes
@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@hnagato
hnagato / brew-rbenv-2012-03-01.sh
Created March 1, 2012 09:14
Install ruby with homebrew, rbenv and ruby-build on OSX 10.7
# Install rbenv, ruby-build and readline
brew install rbenv ruby-build readline
brew link readline
# Add rbenv init to .zshenv
cat <<-EOF | ruby -pe 'gsub("\\", "")' >> .zshenv
# rbenv
if which rbenv >/dev/null 2>&1; then
eval "$\(rbenv init -\)"
source /usr/local/Cellar/rbenv/0.3.0/completions/rbenv.zsh
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@lsaffie
lsaffie / pre-commit
Created August 5, 2012 20:00
pre-commit git hook that checks for values in the FORBIDDEN array
#!/bin/bash
# Pre commit hook that prevents FORBIDDEN code from being commited.
# Add unwanted code to the FORBIDDEN array as necessary
FILES_PATTERN='\.(rb|js|coffee)(\..+)?$'
FORBIDDEN=( debugger ruby-debug )
for i in "${FORBIDDEN[@]}"
do
@pedrobachiega
pedrobachiega / index.markdown
Created August 8, 2012 21:34
Integrações RD Station - HTML puro

Integrações RD Station

HTML Puro

Para quem não tem conhecimento técnico, a integração via HTML Puro é a mais simples de integrar ao RD Station. Mas, infelizmente, ainda é preciso fazer algumas pequenas modificações no seu arquivo HTML.

Usando a API

Quatro coisas são necessárias editar/adicionar na sua página para a integração funcionar: