Skip to content

Instantly share code, notes, and snippets.

Jonas Grau jgrau

Block or report user

Report or block jgrau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jgrau on github.
  • I am jgrau ( on keybase.
  • I have a public key ASDooTkZGBqM8T3cqDQolznE87B4pTov1LYG_7ehACY94wo

To claim this, I am signing this object:

jgrau / update-all-gems
Created Aug 15, 2016
A ruby script to update all gems one by one; running tests between each updated gem and committing to git.
View update-all-gems
#!/usr/bin/env ruby
# Makes accessing the latest exitstatus a bit easier
require 'English'
# Updates all the outdated gems one by one and commits the changes
# for every gem update. This should make it a lot easier to revert
# a gem update.
class UpdateAllGems
jgrau /
Created Jun 27, 2016 — forked from Chompas/
Bash script to create multiple Github labels at once
#!/usr/bin/env bash
# This is a modification from
# Colours and convention picked from
## Instructions
# Bash 4+ is needed because of associative arrays
# jq (
# Create access Token from Github ( and save it under ".token" file
# Comment / Uncomment / Add, all the labels you want
jgrau / gist:3787671
Created Sep 26, 2012
Example C# documentation
View gist:3787671
/// <summary>
/// This class performs an important function.
/// </summary>
public class TestClass
// Single parameter.
/// <param name="Int1">Used to indicate status.</param>
public static void DoWork(int Int1)
View gist:959953
sum = 0
"23:34:02".split(":").each_with_index do |n, i|
case i
when 0
sum = sum+n.to_i*60*60
when 1
sum = sum+n.to_i*60
when 2
sum = sum+n.to_i
View gist:959937 + (Time.parse("23:34:02")
jgrau / devise.da.yml
Created Oct 21, 2010
Updated to accomodate devise 1.4.5
View devise.da.yml
expired: "er udløbet. Vær venlig at bede om en ny"
not_found: "ikke fundet"
already_confirmed: "er allerede bekræftet"
not_locked: "var ikke låst"
one: "1 fejl medførte at denne %{resource} ikke kunne gemmes:"
other: "%{count} fejl medførte at denne %{resource} ikke kunne gemmes:"
View views_migration
class CreateViews < ActiveRecord::Migration
def self.up
create_table :views, :force => true do |t|
t.references :loggable, :polymorphic => true
t.string :session_id
t.string :originating_ip
t.string :uri
View syntax error
# ofcause action_path doesn't work with this syntax
def init_and_slug_redirect
@place = Place.published.find(params[:id])
action = self.action_name
redirect_to action_path(@place), :status => :moved_permanently unless
You can’t perform that action at this time.