Skip to content

Instantly share code, notes, and snippets.

View bastosmichael's full-sized avatar
🏠
Working from home

Michael Bastos bastosmichael

🏠
Working from home
View GitHub Profile
=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')
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
require 'webmock/rspec'
require 'factory_girl'
require 'factory_girl_rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
@bastosmichael
bastosmichael / wordpress-redis.sh
Last active August 29, 2015 13:57
Basic Redis WordPress Installer
#!/bin/bash
if [ $# -eq 0 ]
then
echo "wordpress-redis.sh [options] install|mysql
install - Automatically installs wordpress without database
database - Automatically installs wordpress with mysql"
elif [ $1 == 'install' ]; then
@bastosmichael
bastosmichael / something_csv.rb
Created March 10, 2014 21:42
Simple Ruby CSV Model
require 'csv'
class SomethingCSV
def initialize(io, relation)
@target = io
@relation = relation
@headers = [ "Name",
"SomeValue",
"AnotherValue"
]
end
@bastosmichael
bastosmichael / kandan.sh
Last active August 29, 2015 13:56
Kandan Ubuntu Installer
#!/bin/bash
if [ $# -eq 0 ]
then
echo "kandan.sh [options] postgres|restart
postgres - Automatically install gitlab with postgres on ubuntu
elif [ $1 == 'postgres' ]; then
echo "Updating Operating System..."
#!/bin/bash
if [ $# -eq 0 ]
then
echo "https.sh [options] install"
elif [ $1 == 'install' ]; then
echo "Self signing SSL Certs..."
sudo mkdir /etc/nginx/ssl
@bastosmichael
bastosmichael / gitlab6.5.sh
Last active August 29, 2015 13:55
Gitlab 6.5 Ubuntu Installer
#!/bin/bash
if [ $# -eq 0 ]
then
echo "gitlab.sh [options] postgres|mysql|restart
postgres - Automatically install gitlab with postgres on ubuntu
mysql - Automatically install gitlab with mysql on ubuntu (Not Finished)"
elif [ $1 == 'postgres' ]; then
@bastosmichael
bastosmichael / etc-network-interfaces
Last active December 30, 2015 12:39
Ubuntu NAT setup between eth0 and eth1
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
<?php
echo 'This has been customized!!!';
// Perform post-install customizations
if ( function_exists( 'add_action' ) ){
add_action( 'wp_mail_content_type' , customize_install );
function customize_install(){
// Switch themes
switch_theme('twentytwelve');
@bastosmichael
bastosmichael / default
Last active December 28, 2015 11:08
Nginx Rails Config
server {
listen 80;
server_name localhost;
root /home/ubuntu/app/current/public;
try_files $uri/index.html $uri.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;