Skip to content

Instantly share code, notes, and snippets.

View thokra's full-sized avatar

Thomas Krampl thokra

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thokra on github.
  • I am thokra (https://keybase.io/thokra) on keybase.
  • I have a public key whose fingerprint is A22E 80C6 E810 064D 98AC 144E BD0B 9339 1D42 65C8

To claim this, I am signing this object:

Section "InputClass"
Identifier "R.A.T."
MatchUSBID "0738:1708"
Driver "evdev"
Option "Buttons" "17"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17"
Option "AutoReleaseButtons" "13 14 15"
Option "ZAxisMapping" "4 5 6 7"
EndSection
App = window.App = Ember.Application.create()
DS.RESTAdapter.reopen
host: "http://localhost:4567"
App.Store = DS.Store.extend
adapter: DS.RESTAdapter
@thokra
thokra / gist:5161372
Last active December 14, 2015 22:49

Hvordan bruke Github under NITH

1: Sørg for at du, og resten av gruppen, har registrert dere på Github.com. Det holder fint med en gratisbruker. Send deretter en epost til jonhra at nith med gruppenummer og medlemmer.

2: Etter registrering sørg for å fikse SSH keys til din bruker. https://help.github.com/articles/generating-ssh-keys

3: Når dere har fått tilgang til organisasjonen så er dere nødt til å bytte til denne når dere har logget inn på Github. Det gjøres på forsiden, som vist på dette bildet: http://d.pr/i/Zlsh

Det er fint mulig å bruke (hvertfall) de offesielle Github GUI-ene for å koble til Organisasjons-repoer.

#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO
@thokra
thokra / easy_way.rb
Created September 2, 2012 11:55 — forked from mislav/easy_way.rb
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
@thokra
thokra / add_wp_security.rb
Created February 29, 2012 12:48
Quick and dirty wp security thing. Renaming constants, filenames and directorynames
#!/usr/bin/env ruby
# encoding: utf-8
if RUBY_VERSION.to_f < 1.9
raise "You have to use ruby 1.9 or higher"
end
require 'fileutils'
RENAME_FILES = true
$(document).ready(function () {
$('#load_fade').fadeOut(1000);
var currOffset = 0;
var itemWidth = 976;
var entries = $(".entry");
var numProjects = entries.length;
$(document).keydown(function (e) {
var current;
@thokra
thokra / gist:1170236
Created August 25, 2011 08:34
Quick install
#!/usr/bin/env bash
echo "Checking for SSH key, generating one if it doesn't exist ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
echo "Installing Homebrew, a good OS X package manager ..."
@thokra
thokra / Terminal
Created July 10, 2011 00:12
Remove a local Software updater
cd /Library/Managed Preferences/[username]
sudo mv com.apple.SoftwareUpdate.plist com.apple.SoftwareUpdate.back
sudo touch com.apple.SoftwareUpdate.plist