Skip to content

Instantly share code, notes, and snippets.

@etaque
etaque / .bashrc
Created July 8, 2009 21:53 — forked from defunkt/.bashrc
# $ tweet Hi mom!
#
# Put this in ~/.bashrc or wherever.
# If it doesn't work, make sure your ~/.netrc is right
#
# (Thanks to @anildigital and @grundprinzip for curl-fu)
function tweet {
curl -n -d status="$*" https://twitter.com/statuses/update.xml --insecure &> /dev/null
echo "tweet'd"
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
#!/bin/bash
#
# Download and install libevent and memcached from source on Debian Etch or
# Debian Lenny.
#
# Assumptions
# - libevent and memcached have not been installed from apt repositories
# - memcached is not already running
# - it is ok to clobber scripts at
# /etc/memcached.conf
require 'action_controller/test_process'
class Factory
module FixtureFileUpload
def fixture_file_upload(attr_name, path, mime_type=nil, binary=false)
uploaded_file = ActionController::TestUploadedFile.new(
Test::Unit::TestCase.respond_to?(:fixture_path) ? Test::Unit::TestCase.fixture_path + path : path,
mime_type,
binary
)
add_attribute attr_name, uploaded_file
@etaque
etaque / manager.rb
Created December 13, 2012 14:51 — forked from anonymous/manager.rb
An attempt to use Stomp gem inside Celluloid actor.
module Actors
class Manager
include Celluloid
include Celluloid::Logger
def initialize
@brokers = CONF.brokers.voip
@brokers.each do |broker, conf|
StompListener.supervise_as("#{broker}_listener".to_sym,
current_actor,
@etaque
etaque / README.md
Last active December 10, 2015 02:39 — forked from colinsurprenant/daemon.rb
An attempt to daemonize JRuby scripts with Spoon gem.

Usage:

SpoonDaemon.new('start', 'path/to/my/script.rb', 'tmp/pids')
@etaque
etaque / deploy.sh
Last active August 29, 2015 14:06 — forked from gre/deploy.sh
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
rsync -va target/ $REMOTE:$REMOTE_APP/target;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
@etaque
etaque / Main.elm
Created February 1, 2017 06:17 — forked from nmk/Main.elm
module Main exposing (..)
import Form exposing (..)
import Form.Input as Input
import Form.Validate exposing (..)
import Html exposing (..)
type Color
= Red