Skip to content

Instantly share code, notes, and snippets.

@gorenje
gorenje / .rvmrc
Created March 4, 2012 10:53
Generating a qrcode in a terminal window
rvm use --create ruby-1.9.2-p180@grcode
@gorenje
gorenje / my_gitfow
Created May 4, 2012 14:30
git flow on the command line with hub
For this to work, i use a commit hook that automagically includes a ref #... in all commits on
a feature branch ===> https://gist.github.com/1012062
This also assumes that you have a remote called 'wooga' that is the master of your fork. The owner
of the master repository is also assumed to be 'wooga'.
prompt(master)> git-fetch-all ## see https://gist.github.com/1012002
prompt(master)> git merge wooga/master ## update local master
prompt(master)> git push ## update origin, i.e. my fork
@gorenje
gorenje / feature_branch.rb
Created May 6, 2012 09:54
hub extenstion commands
class String
def remove_indent
self =~ /\A([ \t]+)/ ? gsub(/\n#{$1}/, "\n").strip : self
end
end
module Hub
module Commands
def feature_branch(args)
user_arg, issue_num, postfix = nil, nil, nil
@gorenje
gorenje / hub
Created May 6, 2012 15:21
hub standalone with extension commands
#!/usr/bin/env ruby
#
# This file, hub, is generated code.
# Please DO NOT EDIT or send patches for it.
#
# Please take a look at the source from
# https://github.com/defunkt/hub
# and submit patches against the individual files
# that build hub.
#
@gorenje
gorenje / Gemfile
Created June 8, 2012 11:05 — forked from fairchild/Gemfile
An example sinatra omniauth client app
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
@gorenje
gorenje / svngit.textile
Created June 9, 2012 09:20
Subversion v. Git - Thinking in patches

Introduction

This post attempts to provide Subversion developers a new perspective on Git and how git is differs from
subversion but not using the usual “git is distributed development” or “git is peer-to-peer versioning
management”, which tend not provide an argument for an existing subversion project to switch to git.

Instead, I will attempt to provide a historical background to the development of the first versioning
tools and how these lead to the development of git. It is more that probably that certain historical events
mentioned here are completely and utterly wrong, this not intended. Corrections and improvements are very
welcome!

@gorenje
gorenje / gist:3076191
Created July 9, 2012 12:26
how to use Zendesk API Gem
require 'zendesk_api'
# retrieve login details from yml file.
z = get_login_details(:zendesk)
client = ZendeskAPI::Client.new do |config|
config.url = "https://#{z.first}.zendesk.com/api/v2"
config.username = z[1]
config.password = z.last
require 'logger'
@gorenje
gorenje / gist:3972903
Created October 29, 2012 10:42
get-password.rb
#!/usr/bin/ruby
#
# Author: Gerrit Riessen, [email protected]
# Copyright (C) 2009 Gerrit Riessen
# This code is licensed under the GNU Public License.
#
# $Id$
require 'rubygems'
require 'fileutils'
@gorenje
gorenje / gist:3999947
Created November 2, 2012 10:16
TravisCI Private Builds - private repo which references a private gem can't build

Scenario:

Private repo which references a private gem can't be built because the gem can't be checked out. The gem in question is installed via bundler and a Gemfile.

Question:

I saw in the output of the test that TravisCI creates a id_rsa key:

@gorenje
gorenje / xmas.ino
Last active December 10, 2015 07:28
Ardunio Xmas Tree
// -*- c -*-
#define TO_INT(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
(256*arg1) + (128*arg2) + (64*arg3) + (32*arg4) + (16*arg5) + \
( 8*arg6) + ( 4*arg7) + ( 2*arg8) + ( 1*arg9)
const int lookup[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256 };
const int SwitchPin = 13;
const int SwitchPin2 = 12;