Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub Profile
@relaxdiego
relaxdiego / gist:2048332
Created March 16, 2012 03:20
Installing Release Dashboard to CentOS 5
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
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-{date}
@relaxdiego
relaxdiego / gist:2128650
Created March 19, 2012 23:57
Sample Feature File
# 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
Feature: Create a User
Background:
* 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>
@relaxdiego
relaxdiego / gist:2424861
Created April 19, 2012 23:35
Reasons...
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 | [email protected] | fkd2350a | fkd2350a | Created |
| astark | [email protected] | ++afd]3b | ++afd]3b | Created |
source ~/.git-completion.sh
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NORMAL="\[\033[m\]"
PS1="$GREEN\w$YELLOW\$(__git_ps1)$NORMAL $ "
>>> 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}'`
URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
PROFILE="$HOME/.bash_profile"
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
fi
require 'formula'
class Dblatex < Formula
url 'http://downloads.sourceforge.net/project/dblatex/dblatex/dblatex-0.3/dblatex-0.3.tar.bz2'
homepage 'http://dblatex.sourceforge.net'
md5 '7de6bf72b8b2934169ce0ec911e966ed'
def install
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-scripts=#{bin}"
end
module Aviator
define_request :create_tenant do
meta :provider, :openstack
meta :service, :identity
meta :api_version, :v2
meta :endpoint_type, :admin
link 'documentation',
#!/usr/bin/env ruby
class Fixnum
def +(other)
2
end
end
puts 1 + 1 + 1