Skip to content

Instantly share code, notes, and snippets.

View pyykkis's full-sized avatar

Jarno Keskikangas pyykkis

  • Subtle Insights Oy
  • Finland
View GitHub Profile
@pyykkis
pyykkis / nginx
Created February 3, 2011 13:29
nginx startup script for ubuntu
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
@pyykkis
pyykkis / rvm-notes.txt
Created February 11, 2011 09:41
RVM installation notes
RVM: Shell scripts enabling management of multiple ruby environments.
RTFM: http://rvm.beginrescueend.com/
HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
Installing RVM to /home/foobar/.rvm/
Correct permissions for base binaries in /home/foobar/.rvm/bin...
Copying manpages into place.
Notes for Linux ( DISTRIB_ID=Ubuntu
@pyykkis
pyykkis / .bashrc
Created February 11, 2011 11:13
bashrc for system-wide rvm installation
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [ -n "$PS1" ] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@pyykkis
pyykkis / code.js
Created April 1, 2011 06:41 — forked from thiagofm/code.js
var mongoose = require('mongoose');
var db = mongoose.connect('mongodb://localhost/mydb');
var Schema = mongoose.Schema;
var Posts = new Schema({
name : String,
subject: String,
comment : String,
password: String,
});
We couldn’t find that file to show.
@pyykkis
pyykkis / foo.sh
Created April 4, 2011 06:44
Jenkins cucumber step
#!/bin/bash -le
rvm use ree
# Run integration tests
export DISPLAY=:99
/etc/init.d/xvfb start
RAILS_ENV=test rake cucumber:ci
RESULT=$?
@pyykkis
pyykkis / git guide
Created April 12, 2011 20:04
Guide for git branches, remotes and merge requests
# clone your fork of qa-reports from gitorious
git clone git@gitorious.org:~shaofengtang/meego-quality-assurance/release-version-qa-reports.git
# create a branch to follow upstream, i.e., qa-reports/master
git checkout -b upstream
# configure upstream repository in order to pull in new changes easily
git remote add upstream git://gitorious.org/meego-quality-assurance/qa-reports.git
git pull upstream master
@pyykkis
pyykkis / api.feature
Created April 19, 2011 14:20
Failing cucumber scenario
Scenario: Sending REST import first with user defined test environment and then without
Given I have sent a request with optional parameter "environment_txt" with value "Emulator" via the REST API
When the client sends file "sim.xml" via the REST API
Then the REST result "ok" is "1"
And I should be able to view the latest created report
Then I should see "Hardware: N900"
@pyykkis
pyykkis / rspec_DI_intro.rb
Created August 31, 2011 03:52
Feeding mock objects DI style
-----------------
my_world.rb
class MyWorld
def initialize
@king = King.new
end
def king_of_the_world
@pyykkis
pyykkis / rspec_intro.rb
Created August 31, 2011 03:57
Mock objects rspec style
-----------------
my_world.rb
class MyWorld
def initialize
@king = King.new
end
def king_of_the_world