Skip to content

Instantly share code, notes, and snippets.

View akuhn's full-sized avatar

Adrian Kuhn akuhn

  • Command-line
View GitHub Profile
@akuhn
akuhn / twitter-dark-navbar.user.js
Last active January 3, 2016 06:29
Missing Twitter's dark navigation bar? Same here. Fixed.
// ==UserScript==
// @name Twitter Dark Navbar
// @namespace http://example.com
// @description hacked with love by @akuhn
// @include https://twitter.com/*
// @version 1
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
@akuhn
akuhn / layout.html
Created December 13, 2013 09:40
Nested layouts for d3.
<html>
<head>
<script src="d3.v3.min.js" charset="utf-8"></script>
<style>
rect {
stroke: blue;
fill: #eee;
}
</style>
</head>
@akuhn
akuhn / twitter-photo-preview-fixed.user.js
Last active December 27, 2015 03:09
Don’t like Twitter's new photo preview? Same here. Fixed.
// ==UserScript==
// @name Disable Photo Preview on Twitter
// @namespace http://example.com
// @description hacked with love by @akuhn
// @include https://twitter.com/*
// @version 1
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
@akuhn
akuhn / reverse.user.js
Last active December 23, 2015 14:59
Reverse web for Niko’s inverse party.
// ==UserScript==
// @name Reverse Web
// @namespace http://www.example.com
// @grant
// ==/UserScript==
function reverseWordButKeepCase(str) {
var buffer = ""
for (var i = 0, j = str.length - 1; i < str.length; i++, j--) {
if (str.charAt(i) == str.charAt(i).toUpperCase()) {
var http = require('http');
var shared = {count: 0}
var server = http.createServer(function (req, res) {
console.log([req.method,req.url])
res.writeHead(200, {'Content-Type': 'text/plain'})
res.write('You called me ' + (shared.count += 1) + ' times!\n')
res.write('You are looking at ' + req.url + '\n')
@akuhn
akuhn / icse2013-preprint.md
Created November 29, 2012 23:19
Preprints of ICSE 2013 papers

Preprints of ICSE 2013 papers

Found 21 preprints so far of the 85 papers listed here, http://2013.icse-conferences.org/content/accepted-papers-technical-research-track (most recent additions first)

If yours is missing, tweet or email me! The same if you find a false positive.

What Good Are Strong Specifications? Nadia Polikarpova, Carlo A. Furia, Yu Pei, Yi Wei, and Bertrand Meyer (ETH Zurich, Switzerland)

@akuhn
akuhn / Promise.java
Created November 23, 2012 19:02
Avoid callback hell in Eclipse.
package com.example;
import static org.junit.Assert.assertEquals;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.concurrent.CountDownLatch;
import org.junit.Test;
public class Promise {