Skip to content

Instantly share code, notes, and snippets.

View moll's full-sized avatar

Andri Möll moll

View GitHub Profile
@moll
moll / tab_groups.jq
Last active November 23, 2017 22:09
Extract Firefox Tab Groups from `sessionstore.js`
(
.windows[0].extData."tabview-group" |
fromjson |
map({key: .id | tostring, value: .}) |
from_entries
) as $groups |
.windows[0].tabs |
map(select(.extData."tabview-tab")) |
@moll
moll / Makefile
Created August 13, 2017 21:41
Uglify Makefile
FILES = $(patsubst %, public/assets/%.js, html5)
UGLIFY = ./node_modules/.bin/uglifyjs
UGLIFY_OPTS = --stats --mangle
minify: $(patsubst %.js, %.min.js, $(FILES))
@for file in $^; do mv "$$file" "$${file%.min.js}.js"; done
public/assets/%.max.js: public/assets/%.js
@mv "$<" "$@"
@moll
moll / keybase.md
Created July 22, 2014 09:45
Keybase Proof

Keybase proof

I hereby claim:

  • I am moll on github.
  • I am moll (https://keybase.io/moll) on keybase.
  • I have a public key whose fingerprint is 148F 4094 4D26 C87F 8639 9523 E976 9517 00BB 3645

To claim this, I am signing this object:

@moll
moll / controller.js
Last active January 2, 2016 08:09
World's smallest useful Node.js Express web controller library you can do. Say no to frameworks!
var inherit = require("descend")
var Controller = module.exports = function(req, res, next) {
this.req = req
this.res = res
this.next = next
}
Controller.inherit = function() {
var heir = inherit.apply(this, arguments)
@moll
moll / migrate_sessions_to_devise_3.rb
Created September 2, 2013 21:56
Because Devise 3 (and/or Warden) changed the signature of the session info, all sessions were invalidated and thereby people logged out. You do *not* log people out unless they ask for it. Capisce? This migration migrates migraines by migrating those sessions. Replace the word "account" and "Account" if your account model isn't named Account, bu…
class MigrateSessionsToDevise3 < ActiveRecord::Migration
class Session < ActiveRecord::Base
attr_protected
serialize :data, JSON
end
def up
Session.find_each do |session|
warden = session.data["warden.user.account.key"]
next unless warden