Skip to content

Instantly share code, notes, and snippets.

View gr4y's full-sized avatar

Sascha Wessel gr4y

View GitHub Profile
Feature: Manage Projects
In order to manage projects
As a developer
I want to create and manage projects
Scenario: Projects List
Given I have projects titled blog-app, todo-app
When I go to the list of projects
Then I should see "my blog-app"
And I should see "my todo-app"
<div class="nav">
<%= link_if_action ["new","edit","show"], t("project.back"), projects_path %>
<%= link_if_action "index", t("project.new"), new_project_path %>
</div>
<?php
header("Content-Type: application/json");
echo json_encode(array("time"=>time()));
?>
#!/usr/bin/env ruby
require 'rubygems'
require 'streambot'
@blacklist = ['LeipzigerBimmel','lvb_rt','rt_leipzig','oepnv_leipzig','rt_fail']
@keywords = ["#LVB","#lvb"]
@auth = {:username=>'user',:password=>'password'}
bot = StreamBot::Tracker.new(@auth, @blacklist, @keywords)
bot.start
#!/usr/bin/env ruby
require 'streambot'
@params = {"auth_type" => "oauth",
"oauth" => {"key" => "consumer key", "secret" => "consumer secret"},
"http" => {"username" => "username", "password" => "password"}
}
@blacklist = ['mac_rt','apple_rt']
bot = StreamBot::Tracker.new(@params, @blacklist, 'apple','ipad','iphone os 4','steve jobs')
bot.start
<%= flash_messages %>
@gr4y
gr4y / articles_test.rb
Created June 25, 2010 11:21
Benchmark with ActiveRecord and paper_trail
require 'test_helper'
require 'benchmark'
class ArticlesTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "benchmark" do
Benchmark.bm do |b|
# create an article with paper_trail
b.report("create") do
Article.paper_trail_on
function the_category_filter($thelist,$separator=' ') {
$childrens = get_categories("child_of=".the_print_category_id());
$exclude=array();
$exclude[] = get_category(the_print_category_id())->name;
$exclude[] = get_category(the_special_category_id())->name;
foreach($childrens as $category){
$exclude[] = $category->name;
}
$cats = explode($separator,$thelist);
@gr4y
gr4y / .bashrc
Created September 11, 2010 14:59
# show the actual git branch in command line prompt
export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") $ '
alias /sync "/media/disk/sync"
<Directory "/media/disk/sync">
Dav On
Allow from all
</Directory>
#
# doesn't work with iWorks for iPad
# shame on apple
#