Skip to content

Instantly share code, notes, and snippets.

View pfleidi's full-sized avatar

Sven Pfleiderer pfleidi

View GitHub Profile
after 'deploy:stop', 'puma:stop'
after 'deploy:start', 'puma:start'
after 'deploy:restart', 'puma:restart'
_cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
_cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
_cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
_cset(:puma_role) { :app }
namespace :puma do
Operating system: Linux
0.0.0 Linux 2.6.32-350-ec2 #57-Ubuntu SMP Thu Nov 15 15:59:03 UTC 2012 x86_64
CPU: amd64
family 6 model 26 stepping 5
2 CPUs
Crash reason: SIGSEGV
Crash address: 0x0
Thread 0 (crashed)
Operating system: Mac OS X
10.8.2 12C60
CPU: x86
GenuineIntel family 6 model 37 stepping 5
4 CPUs
Crash reason: EXC_BAD_ACCESS / KERN_PROTECTION_FAILURE
Crash address: 0x58
Thread 0 (crashed)
@pfleidi
pfleidi / wc.rb
Created April 3, 2012 17:07
Stupid implementation of the unix tool wc in Ruby
#!/usr/bin/env ruby
require 'optparse'
options = {}
# parse commandline options
OptionParser.new do |opts|
opts.banner = "Usage: #{__FILE__} [-lmw] [file]"
@pfleidi
pfleidi / wordpressdotcom.rb
Created March 31, 2012 11:57
Slightly modified version of stock wordpress -> jekyll importer
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'yaml'
require 'time'
module Jekyll
# This importer takes a wordpress.xml file, which can be exported from your
@pfleidi
pfleidi / timeoutclient.js
Created May 28, 2011 13:39
Create custom timeouts for Node.js http.ClientRequest
var http = require("http");
var TIMEOUT_VALUE = 2020;
var options = {
host: 'localhost',
port: 3000,
path: '/',
method: 'GET'
};
@pfleidi
pfleidi / gvimrc
Created April 13, 2011 10:08
Map Command-# to switch tabs
" Map Command-# to switch tabs
map <D-0> 0gt
imap <D-0> <Esc>0gt
map <D-1> 1gt
imap <D-1> <Esc>1gt
map <D-2> 2gt
imap <D-2> <Esc>2gt
map <D-3> 3gt
imap <D-3> <Esc>3gt
map <D-4> 4gt
@pfleidi
pfleidi / AndroidManifest.xml
Created March 9, 2011 13:27
The generated android manifest of a titanium mobile application
<?xml version="1.0" ?><manifest android:versionCode="1" android:versionName="1" package="com.mwaysolutions.barcodeexample" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="4"/>
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
<!-- TI_MANIFEST -->
<application android:debuggable="false" android:icon="@drawable/appicon" android:label="Barcode Example" android:name="BarcodeExampleApplication">
<activity android:configChanges="keyboardHidden|orientation" android:label="Barcode Example" android:name=".BarcodeExampleActivity" android:theme="@style/Theme.Titanium">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@pfleidi
pfleidi / fiberchat.rb
Created February 19, 2011 18:51
A naive socket chat using select() and ruby fibers
require 'rubygems'
require 'socket'
include Socket::Constants
class ChatServer
def initialize
@reading = Array.new
@writing = Array.new
@clients = Hash.new
@pfleidi
pfleidi / template.tex
Created February 9, 2011 00:11
My basic LaTeX template
\documentclass[11pt,titlepage,a4paper,english]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{underscore}
\usepackage{caption}
\usepackage{listings}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}