Skip to content

Instantly share code, notes, and snippets.

View lindskogen's full-sized avatar
🏃‍♂️

Johan Lindskogen lindskogen

🏃‍♂️
View GitHub Profile
@lindskogen
lindskogen / index.html
Created April 5, 2017 11:30
Swish Redirect
<html>
<head>
<title>Swish redirect</title>
<script>
var search = window.location.search;
var params = search.substr(1).split('&').map(function(arg){
return arg.split('=', 2);
}).reduce(function(acc, items) {
acc[items[0]] = decodeURIComponent(items[1]);
return acc;
@lindskogen
lindskogen / active_record_log_subscriber.rb
Created November 21, 2016 13:31
ActiveRecordLogSubscriber
# Drop this into config/initializers to print line number of each query called by ActiveRecord
module LogQuerySource
def debug(*args, &block)
return unless super
backtrace = Rails.backtrace_cleaner.clean caller
relevant_caller_line = backtrace.detect do |caller_line|
!caller_line.include?('/initializers/')
@lindskogen
lindskogen / nomad-login.sh
Created May 25, 2015 12:30
Nomad login via curl or wget
# Using curl:
curl 'https://login.nomad.chalmers.se' --data 'action=Login&login=$USERNAME/net&password=$PASSWORD&org=Radius'
# Using wget: (on Ubuntu for example)
wget 'https://login.nomad.chalmers.se' --post-data 'action=Login&login=$USERNAME/net&password=$PASSWORD&org=Radius'
@lindskogen
lindskogen / sf.js
Created March 22, 2015 13:30
sf.se set Gothenburg as city, "no" expire
document.cookie = "ActiveCity__www.sf.se__sv=Z2JfX19nJWMzJWI2dGVib3Jn; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/"

Keybase proof

I hereby claim:

  • I am lindskogen on github.
  • I am jlindsk (https://keybase.io/jlindsk) on keybase.
  • I have a public key whose fingerprint is F9FB 80B7 28C7 C523 F818 5DB4 4322 9229 4C53 7B06

To claim this, I am signing this object: