Skip to content

Instantly share code, notes, and snippets.

View mikker's full-sized avatar
👋

Mikkel Malmberg mikker

👋
View GitHub Profile
#!/usr/bin/env ruby
# install
# $ gem install nokogiri
# usage
# $ ./whodis-p6.rb
# # => Thom Yorke - The Mother Lode
require 'nokogiri'
require 'open-uri'
@mikker
mikker / p6-to-rdio.rb
Last active August 29, 2015 14:11
Search Rdio for currently playing track on DR P6
#!/usr/bin/env ruby
require 'uri'
track = `whodis-p6`.chomp.gsub("'", '')
search_url = "http://www.rdio.com/search/#{URI.escape track}/"
system "open -a Rdio #{search_url}"
@mikker
mikker / garbify.sh
Last active August 29, 2015 14:11 — forked from ftrain/garbify.sh
#!/bin/bash
#
# _ _ __
# __ _ __ _ _ __| |__ (_)/ _|_ _
# / _` |/ _` | '__| '_ \| | |_| | | |
#| (_| | (_| | | | |_) | | _| |_| |
# \__, |\__,_|_| |_.__/|_|_| \__, |
# |___/ |___/
#
#
@mikker
mikker / config.ru
Last active August 29, 2015 14:16
numnumnum is a stupid Krak.dk scraper API - http://numnumnum.herokuapp.com
require 'bundler/setup'
Bundler.require :default
require 'json'
require 'open-uri'
require 'cgi'
class Info < Struct.new(:type, :name, :phone, :address, :postal_code, :city)
def self.from_person handler
name = handler.css('.hit-name-ellipsis').text.strip
(function() {
'use strict'
// Disclaimer: Politiken is a good newspaper. If you use their website
// a lot you should make an account and probably also a subscription to
// keep them going. https://politiken.dk/bruger/opret
function hideOrWait() {
var elm = document.querySelector('.dit-modal-overlay--transparent') // find overlay
if (!elm) return setTimeout(hideOrWait, 50) // break and try in 5 msecs if it isn't there yet

Keybase proof

I hereby claim:

  • I am mikker on github.
  • I am mikker (https://keybase.io/mikker) on keybase.
  • I have a public key whose fingerprint is 7637 1965 3449 BB63 42E3 87C9 0A4E 6062 8E75 4DD9

To claim this, I am signing this object:

defmodule Receipts.VCRCase do
use ExUnit.CaseTemplate
using do
quote do
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
end
end
setup_all do
@mikker
mikker / open.sh
Created September 8, 2008 12:02
Shortcut for Mac OS X's `open`
# Opens the current folder or a given file/folder using Finder
# Usage:
# $ o -- opens the current folder
# $ o Desktop -- opens the Desktop-folder
# $ o .profile -- open the file ".profile"
o(){
if [[ $1 ]]; then
open $1
else
open .
@mikker
mikker / clone_tab.sh
Created October 22, 2008 10:27
Clone the current tab in OS X Terminal
#!/bin/bash
# Clones the current tab in OS X Terminal
osascript -e 'tell application "Terminal"' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' -e "do script with command \"cd `pwd`;clear\" in selected tab of the front window" -e 'end tell' &> /dev/null