Skip to content

Instantly share code, notes, and snippets.

Avatar

Johannes Gorset jgorset

View GitHub Profile
View Hyper's job posting.md

Developers, developers, developers!

We are always looking for more developers to join our web, iOS and Android teams. If you’re passionate about building things, we’d really like to talk to you!

Us

We’re a team of twenty keen-witted engineers who do all kinds of things on all kinds of platforms. Right now our favourites are Ruby, JavaScript, Swift and Java, but we’re always excited to try new tools. Really we’re pretty excited about mostly anything that

@jgorset
jgorset / heroku-apps-with-gem.md
Last active Apr 19, 2016
Find all Heroku apps with a given gem
View heroku-apps-with-gem.md
# heroku-apps-with-gem.sh
apps=$(heroku apps | grep -E -v '(^===|^$)' | awk '{print $1}')

set -k

for app in $apps; do
  heroku run "cat Gemfile.lock | grep $1" -a $app --exit-code > /dev/null 2>&1

  if (( $? == 0)); then
View gist:5605665
Stockpile.on :tweet do |tweet|
Tweet.new message: tweet.message
end
View fun.js
foo(); // Logs "foo".
function foo() { console.log("foo") }
foo(); // Raises "ReferenceError: foo is not defined".
foo = function() { console.log("foo") }
foo(); // Raises "TypeError: undefined is not a function".
var foo = function() { console.log("foo") }
View gist:4633368
I'm testing gist-vim. It's pretty awesome. I think. Yes.
View gist:4237588
# Load all rooms.
#
# Returns an array of hashes describing each room.
def all
devices = Device.all
rooms = []
# Go through each device, check wich room it belongs
# do, if the room does not exist, add it to rooms, if
# just add this device to the list of devices
@jgorset
jgorset / gist:3378321
Created Aug 17, 2012
Side-by-side comparison of template tags in Django and Ruby on Rails
View gist:3378321

Side-by-side comparison of template tags in Django and Ruby on Rails

Format the current time

Django

from django import template
import datetime
@jgorset
jgorset / gist:1747655
Created Feb 5, 2012
How Sprockets works with JST and EJS templates
View gist:1747655
// This document distills the magic that happens when you create a file with the ".jst"
// and ".ejs" extensions anywhere on your asset path in Ruby on Rails, courtesy of the
// Sprockets library (https://github.com/sstephenson/sprockets).
//
// For the purpose of this example, imagine that you have created a template for
// messages in `app/assets/javascripts/backbone/templates/messages/message.jst.ejs`
// with the following contents:
//
// <h1><%= user.full_name %></h1>
// <p><%= body %></p>
View gist:840333
# encoding: utf-8
from httplib import HTTPConnection
from base64 import b64encode
from xml.etree import ElementTree
from django.conf import settings
class GateBackend:
"""Aspiro Gate Backend."""
View gist:838488
class Call(models.Model):
call_at = models.DateTimeField()
contestant = models.OneToOneField(Contestant)
confirmed = models.BooleanField()
def confirm(self):
self.confirmed = True
self.save()
def save(self, *args, **kwargs):