Skip to content

Instantly share code, notes, and snippets.

View koffeinfrei's full-sized avatar

Alexis Reigel koffeinfrei

View GitHub Profile
@koffeinfrei
koffeinfrei / README.md
Last active August 29, 2015 14:02
git through proxy
  1. install socat

  2. add git-proxy to your path (e.g. cp git-proxy ~/bin/)

  3. make git-proxy executable (e.g. chmod u+x git-proxy)

  4. add ssh config ssh_config entries to your ssh config (samples for github)

  5. edit the proxy address in git-proxy

  6. edit the proxy address in ssh_config

  7. add git configuration

    needed for ssh urls that require a login (git@github.com:someone/something.git)

@koffeinfrei
koffeinfrei / README.md
Last active August 29, 2015 13:56
rails rake task for checking validity of all rails model entries

Put this file in your rails project at lib/tasks/db.rake. Use it like

$ rake db:data:validate
@koffeinfrei
koffeinfrei / combinations.rb
Last active December 11, 2015 11:48
3 char combinations (of my name)
# try pairs of 2
def pairs_of_2(names)
slices = names.join.scan(/.{2}/)
combinations(slices)
end
# try each chars
def pairs_of_chars(names)
chars = names.join.chars.to_a.uniq
combinations(combinations(chars))
@koffeinfrei
koffeinfrei / backtracking-sudoku-solver.rb
Created October 16, 2012 10:49
really stupid backtracking sudoku solver
=begin
ruby solver
=end
$count = 0
def valid?(state, x, y)
# check in col and row
0.upto(8) do |i|
return false if i != y and state[x][i] == state[x][y]
@koffeinfrei
koffeinfrei / process_locking_clipboard
Created November 21, 2011 08:28
Gets the process that locks the clipboard (i.e. openened but didn't close it)
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace ConsoleApplication1
{
public class Program
{
[DllImport("user32.dll")]
static extern IntPtr GetOpenClipboardWindow();
@koffeinfrei
koffeinfrei / .gitignore
Created September 13, 2011 20:01
Codebrawl #10
input.png
/Gemfile.lock