Skip to content

Instantly share code, notes, and snippets.

View ahem's full-sized avatar

Anders Hellerup Madsen ahem

  • Copenhagen, Denmark
View GitHub Profile
@ahem
ahem / init.vim
Created January 22, 2019 08:42
Neovim configuration before switching to CoC autocomplete
set laststatus=2
set splitright
set splitbelow
set visualbell
set autoindent
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set noignorecase " do casesensitive searching (\c anywhere in pattern for insensitive)
@ahem
ahem / loadimage.js
Created October 18, 2016 12:59
Load and decode images with webworker
/* global createImageBitmap */
function loadImageWithImageTag(src) {
return new Promise((resolve, reject) => {
const img = new Image;
img.crossOrigin = '';
img.src = src;
img.onload = () => { resolve(img); };
img.onerror = () => { reject(img); };
});
@ahem
ahem / MainActivity.java
Created April 29, 2014 19:33
Android parcelling test
package com.issuu.parcelerarraytest.app;
import android.app.Activity;
import android.os.Parcelable;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import org.parceler.Parcel;
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" type="text/css" />
<meta name="description" content="datepicker" />
<meta charset="utf-8">
<title>JS Bin</title>
@ahem
ahem / trac2down.py
Created March 27, 2012 17:45 — forked from sgk/trac2down.py
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
import sqlite3
import datetime
import re
SQL = '''
select
name, version, time, author, text
@ahem
ahem / require-wrap-mootools.js
Created January 11, 2012 00:29
A small node.js script to wrap MooTools.More in RequireJS defines
/*jshint node:true, funcscope:true */
var path = require('path');
var fs = require('fs');
var jsyaml = require('js-yaml');
function checkForError(err) {
if (err) { exitWithUsage(err); }
}
@ahem
ahem / parse_event_log.py
Created September 14, 2010 12:03
Script to parse windows event logs saved as csv
import os, sys, re, operator
from datetime import datetime
def line_gen(input):
for line in input:
yield line
line_pattern = re.compile(r"""
^
// MooTools core functionality usefull for server side developement with node.js
// Exports added to bottom of file so it can be required like a CommonJS module.
/*
---
script: Core.js
description: The core of MooTools, contains all the base functions and the Native and Hash implementations. Required by all the other scripts.
license: MIT-style license.