Skip to content

Instantly share code, notes, and snippets.

View coffeejunk's full-sized avatar
:shipit:

Maximilian Haack coffeejunk

:shipit:
View GitHub Profile
<form>
<select name="menu" onChange="javascript:parent.location =
this.form.menu.options[this.form.menu.selectedIndex].value;">
<option value="lol">lol</option>
{% for country in countries %}
{% if country == active_country %}
<option selected="selected" value="/{{ country.english_name|escape }}">{{ country.english_name }} {{ country.arabic_name }}</option>
{% else %}
<option value="/{{ country.english_name|escape }}">{{ country.english_name }} {{ country.arabic_name }}</option>
{% endif %}
vim_plugin_task "pep8", "git://github.com/nvie/vim-pep8.git"
vim_plugin_task "pyflakes", "git://github.com/nvie/vim-pyflakes.git"
@coffeejunk
coffeejunk / mail.rb
Created August 6, 2011 10:59 — forked from dennisreimann/mail.rb
CIJoe mail notification script.
#!/usr/bin/env ruby
# CIJoe mail notification script.
# Some things in here are shamelessly ripped from
# http://gist.github.com/374030
#
# Call this from your hooks (build-worked, build-failed) with something like:
# ~/ci/scripts/mail.rb ~/ci/PROJECT/ CIJOE_URL BRANCH
#
# Requirements
@coffeejunk
coffeejunk / Questions
Created August 9, 2011 06:44
Frozen Rails Give-away
Day job: student & ceo of octothorp.eu
Your Rails contributions (if any): none, so far.
What's your Ruby/Rails experience?: 1,5 months.. And the crowd goes wild.
How do you use GitHub?: I use GitHub to convince the people I work with to use git. (and of course all the good stuff, code review, issues(!), wiki, gists, not forgetting about projects that might be interesting -> following)
degrees = [
"Bachelor of Science",
"Bachelor of Arts",
"Bachelor of Design",
"Bachelor of Engineering",
"Bachelor of Applied Science",
"Bachelor of Business Administration",
"Bachelor in Management Studies",
"Bachelor of Administrative Studies",
"Bachelor of Commerce",
#!/bin/sh
unset GIT_DIR
cd ..
git reset HEAD --hard
# kill the scheduler if running
pid=$(ps a | grep 'sched.rb' | grep -v 'grep' | cut -d ' ' -f 1)
if [ ! -z "$pid" ]; then
# scheduler script running
kill $pid
fi
ECHO(1) BSD General Commands Manual ECHO(1)
NAME
echo -- write arguments to the standard output
SYNOPSIS
echo [-n] [string ...]
DESCRIPTION
The echo utility writes any specified operands, separated by single blank (` ') characters and followed by a newline (`\n') character, to the standard output.
@coffeejunk
coffeejunk / bot.rb
Created September 29, 2011 07:32 — forked from joakimk/bot.rb
XMPP/Ruby Bot for HipChat with support for multiple rooms
#!/usr/bin/env ruby
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/muc/helper/simplemucclient'
# Most of this is borrowed from https://gist.github.com/941931
# Added support for multiple rooms and external handling of messages.
# We want the MUC functionality to just handle shit for us. Unfortunately we
# have to override/repeat the join method in order to add the directive that
#!/usr/env ruby
#require 'rubygems' # dies nur bei ruby 1.8
require 'sinatra'
post '/oh_yeah' do
pull = `cd git-repo && git checkout master && git pull`
unless pull.chomp == "Already up-to-date."
msg = `cd git-repo && git log -n 1 --format=full`
`cp -r git-repo/* svn-repo/`
`cd svn-repo && svn add --force . && svn commit --message "#{msg}"`
@coffeejunk
coffeejunk / gist:1650653
Created January 21, 2012 01:28
google reverse image homemade 'api'
require 'sinatra'
require 'rest_client'
require 'selenium-webdriver'
# to run this script headless install xvfb
# Xvfb :99 -ac &
# export DISPLAY=:99
post '/' do
begin
puts params.inspect