Skip to content

Instantly share code, notes, and snippets.

Mark Maglana relaxdiego

View GitHub Profile
relaxdiego / gist:2048332
Created Mar 16, 2012
Installing Release Dashboard to CentOS 5
View gist:2048332
yum update
yum groupinstall ‘Development Tools’
yum install readline-devel zlib zlib-devel openssl-devel perl cpio expat-devel gettext-devel
mkdir src
cd src
tar xzvf git-latest.tar.gz
cd git-{date}
relaxdiego / gist:2128650
Created Mar 19, 2012
Sample Feature File
View gist:2128650
# All .feature files begin with a feature declaration
# such as the one below. The description is optional
# and can be made up of arbitrary text. Multiple
# paragraphs are also allowed
Feature: Withdraw Cash
This feature allows an account holder to withdraw
cash from an ATM.
# The background lists a set of assumptions that
# will be applied to each scenario and scenario
View 1_create_a_user.feature
Feature: Create a User
* Clarice is a system administrator
* Dave is an ordinary user
Scenario Outline:
Given <User> is logged in
When she tries to create a user
Then the new user will <Be Created or Not>
View gist:2424861
Scenario Outline: Create a user with certain attributes
Given I am authorized to create users in the system
And a user with username <Username> does not exist in the system
When I create a user with attributes <Username>, <Email>, <Password>, and <Password Confirmation>
Then the user will be <Created or Not>
Examples: Valid User Attributes
| Username | Email | Password | Password Confirmation | Created or Not |
| astark | | fkd2350a | fkd2350a | Created |
| astark | | ++afd]3b | ++afd]3b | Created |
View gist:2626700
source ~/
PS1="$GREEN\w$YELLOW\$(__git_ps1)$NORMAL $ "
View gist:3038426
>>> from my_klass import my_klass
>>> from mocker import Mocker
>>> mocker = Mocker()
# Prepare the mock methods
>>> target = mocker.mock()
>>> target.method1(12) # doctest: +ELLIPSIS
<mocker.Mock object at ...>
>>> mocker.result(5)
>>> target.method2(12) # doctest: +ELLIPSIS
GIT_VERSION=`git --version | awk '{print $3}'`
echo "Downloading git-completion for git version: $GIT_VERSION..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
View dblatex.rb
require 'formula'
class Dblatex < Formula
url ''
homepage ''
md5 '7de6bf72b8b2934169ce0ec911e966ed'
def install
system "python", "", "install", "--prefix=#{prefix}", "--install-scripts=#{bin}"
View gist:6410222
module Aviator
define_request :create_tenant do
meta :provider, :openstack
meta :service, :identity
meta :api_version, :v2
meta :endpoint_type, :admin
link 'documentation',
View gist:6459670
#!/usr/bin/env ruby
class Fixnum
def +(other)
puts 1 + 1 + 1
You can’t perform that action at this time.