Skip to content

Instantly share code, notes, and snippets.

View hapiben's full-sized avatar

Ben hapiben

View GitHub Profile
@hapiben
hapiben / .bash_profile
Created October 2, 2015 07:25 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# First attempting to use Capybara directly, you will ran into issues when trying to set HTTP header.
# Using Basic HTTP Authentication requires that we needed to set the header.
# Also we need to set the Content-Type and Accept headers to ensure that Rails handles the input and output correctly.
# When using Rack, Capybara delegates request and response handling down to Rack::Test.
# So I used Rack::Test directly in my step definitions, and it works.
# Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it
# with methods for get, post, put, delete as well as last_request, last_response, header and more.
# I mixed Rack::Test::Methods into the Cucumber world at the top of our API steps file like so:
##############################
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@hapiben
hapiben / folder-sizes.sh
Created July 2, 2014 10:41
Shows a list of folders with size sorted in order
sudo du -x /var/log | sort -n | tail -40
@hapiben
hapiben / capybara_cheat_sheet
Created April 13, 2013 12:35 — forked from zhengjia/capybara cheat sheet
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')
@hapiben
hapiben / secured-ext-components.js
Created March 15, 2012 05:29
Secured ExtJS Components Implementation
/**
* Button - Normal instantiation
*/
var btn = new GepsRelease4AccessControlSecuredButton({
name: 'btn_Sample' // Required property.
,acp: 'Abstract' // Required property. (Access Rights Prefix)
,text: 'Sample'
,iconCls: 'icon-sample'
});