Skip to content

Instantly share code, notes, and snippets.

View ndrluis's full-sized avatar

Andre Luis Anastacio ndrluis

View GitHub Profile
@ndrluis
ndrluis / Gemfile
Last active August 29, 2015 14:11 — forked from akitaonrails/Gemfile
source 'http://rubygems.org'
gem 'mechanize'
gem 'typhoeus'
gem 'rmagick'
gem 'prawn'
gem 'fastimage'
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
#
# Based on
#
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
=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')

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
class SignupController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.save
redirect_to login_path,
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
function Update(){
if(Input.GetKeyDown("f")){
light.enabled = !light.enabled;
}
}
[info] Updating {file:/Users/andreanastacio/Workspace/src/java/vote-no-filme/}vote-no-filme...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 4 Scala sources and 2 Java sources to /Users/andreanastacio/Workspace/src/java/vote-no-filme/target/scala-2.10/classes...
[info] Creating IDEA module for project 'vote-no-filme' ...
[info] Running compile:managedSources ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2-javadoc.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.10.2!scala-library.jar(doc) (53883ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2-sources.jar ...
@ndrluis
ndrluis / gist:7718919
Last active December 29, 2015 19:39
testing private method
describe "Blah::MyObject" do
before do
my_object = Blah::MyObject.new
end
describe "#thing" do
my_object.send(:thing).should eq(2)
end
end
@ndrluis
ndrluis / applications.yml
Last active December 28, 2015 23:19
Rukuli Spec 1
IMAGE_VIEWER:
darwin:
'Preview'
cygwin|mswin|mingw|bccwin|wince|emx:
"Paint"
FILE_EXPLORER:
darwin:
'Finder'
cygwin|mswin|mingw|bccwin|wince|emx:
"Explorer"