Skip to content

Instantly share code, notes, and snippets.

Ole Bjørn Michelsen omichelsen

Block or report user

Report or block omichelsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
omichelsen / gist:8861701
Last active Aug 29, 2015
JavaScript keySequence
View gist:8861701
function keySequence(callback) {
var i = 0;
var konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
$(document).keydown(function (event) {
if (konami[i] === event.which) {
if (konami.length === i) {
i = 0;
View .gitignore
# Compiled source #
# Packages #
View .gitconfig
st = status
ci = commit
co = checkout
br = branch
alias = config --get-regexp alias
lg = log --graph --decorate --pretty=oneline --abbrev-commit
lgf = log --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative
unstage = reset HEAD
uncommit = reset --soft HEAD^
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Hello World</title>
<h1>Hello World</h1>
omichelsen / data.json
Last active Aug 29, 2015
Parse MediaDeviceService from LogEntries
View data.json
{"r":"353a81d9-091e-479c-9b07-fc1e271d91a5","s":169359380359,"t":1406294298153,"m":" aog5x7dc INFO ' [\"FaceTime HD Camera (Display) (05ac:1112)\",\"FaceTime HD Camera (PUF6:VVDR)\"]'"},
{"r":"353a81d9-091e-479c-9b07-fc1e271d91a5","s":123643402383,"t":1406294317904,"m":" 3197oner INFO ' []'"},
{"r":"353a81d9-091e-479c-9b07-fc1e271d91a5","s":71475116496,"t":1406294381007,"m":" qu2r7yz2 INFO ' [\"FaceTime HD Camera (Built-in) (05ac:8509)\"]'"},
{"r":"353a81d9-091e-479c-9b07-fc1e271d91a5","s":169458215047,"t":1406294454260,"m":" dolfhlfu INFO ' [\"Integrated Webcam (0c45:6433)\"]'"},
{"r":"353a81d9-091e-479c-9b07-fc1e271d91a5","s":123786187023,"t":1406294521582,"m":" qu2r7yz2 INFO ' [\"FaceTime HD Camera (Built-in) (05ac:8509)\"]'"},
View gist:074ffaa3b52b3286afd1
function cartesianProductOf() {
  return, function(a, b) {
    var ret = [];
    a.forEach(function(a) {
      b.forEach(function(b) {
    return ret;
  }, [[]]);
View unique.js
function unique(value, index, self) {
return self.indexOf(value) === index;
View feed.xml.jade
doctype xml
rss(version="2.0", xmlns:atom="")
title= title
link= url
description= description
language= language
atom:link(href="#{ url }feed.xml", rel="self", type="application/rss+xml")
each post, slug in
if slug !== 'index'
omichelsen / PHP: AtomFeed
Created Nov 24, 2015
Helper class for creating an Atom feed
View PHP: AtomFeed
class AtomFeed
private $xml;
function __construct()
$this->xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><feed xmlns="" />');
function setFeedHeader($title, $uri, $updated, $author_name, $author_email, $author_uri)
omichelsen / index.html
Created Dec 28, 2013
Bootstrap Jumbotron Template
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
You can’t perform that action at this time.