Skip to content

Instantly share code, notes, and snippets.

View 5v3n's full-sized avatar

Sven Kräuter 5v3n

View GitHub Profile
@5v3n
5v3n / spec_helper.rb
Created April 13, 2011 15:39
in order to make spork reload routes & any rb file in the app folder:
Spork.each_run do
load "#{Rails.root}/config/routes.rb"
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
end
@5v3n
5v3n / load test faye server.js
Last active December 20, 2015 16:59
load test faye server. connect 200 concurrent clients that subscribe to a channel.
var faye = require('faye');
var clients = [], client;
var responseCount = 0;
for (var i = 0; i < 200; i++) {
client = new faye.Client('http://HOSTNAME/faye');
client.subscribe('/status/realtime', function(message) {
var time = new Date().getTime();
responseCount++;
console.log(responseCount);
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
puts "checking #{app}"
@5v3n
5v3n / chiliproject_to_redmine.rb
Last active November 10, 2015 16:09 — forked from pallan/chiliproject_to_redmine.rb
ruby 2.0.0 compatible version of @pallan 's great chiliproject to redmine migration script (https://gist.github.com/pallan/6663018)
# encoding: UTF-8
# Chiliproject to Redmine converter
# =================================
#
# This script takes an existing Chiliproject database and
# converts it to be compatible with Redmine (>= v2.3). The
# database is converted in such a way that it can be run multiple
# times against a production Chiliproject install without
# interfering with it's operation. This is done by duplicating
@5v3n
5v3n / README.MD
Created December 30, 2011 21:11 — forked from wynst/README.MD
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

 `gem install thor rest-client`

Install this script in Thor:

@5v3n
5v3n / Gemfile
Created September 30, 2011 12:33
supporting oirukan ;-)
source :rubygems
gem 'oirukan', :git => "git://github.com/filtercake/oirukan.git"
@5v3n
5v3n / Gemfile
Created May 4, 2011 06:29
Makeshift fix for tweetlr issue #2 - missing curb dependency
source :rubygems
gem 'curb'
gem 'tweetlr'
// Controlling the modulation of an LED using a potentiometer (variable resistor)
int ledpin = 3; // light connected to digital pin 3
int potpin = A3; // analog pin used to connect the potentiometer
int sensorValue, outputValue; // variables to read the values
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
require 'rubygems'
require 'fileutils'
require 'pathname'
require 'ruby-debug'
require 'ostruct'
require 'rest_client'
require 'json'
# multiple gems use the require tumblr, this one refers to http://github.com/mwunsch/tumblr
# note that ruby-debug and the weary lib, which makes reqs for this tumblr gem, don't play nicely together
@5v3n
5v3n / .vimrc
Created November 16, 2010 19:08
basic .vimrc
if has("autocmd")
filetype plugin indent on
endif
set sw=2
set sts=2
set background=dark
set cindent
set smartindent
set autoindent
set expandtab