Skip to content

Instantly share code, notes, and snippets.

{ pkgs ? (import <nixpkgs> {})
, stdenv ? pkgs.stdenv
, xdotool ? pkgs.xdotool
, makeWrapper ? pkgs.makeWrapper
, wmctrl ? pkgs.wmctrl
, fetchFromGitHub ? pkgs.fetchFromGitHub
, bash ? pkgs.bash
, python3 ? pkgs.python3
, libinput ? pkgs.libinput
, procps ? pkgs.procps

Keybase proof

I hereby claim:

  • I am yorickvp on github.
  • I am yorickvp (https://keybase.io/yorickvp) on keybase.
  • I have a public key ASDL4mFp5PyVeysyX677R1QZi-KBg5DoPBa8wf3CMcq4ego

To claim this, I am signing this object:

@yorickvP
yorickvP / .gitignore
Last active September 20, 2016 09:56
electron-desktop
node_modules
let
pkgs = import <nixpkgs> {};
pypkg = pkgs.python27Packages;
in
{ stdenv ? pkgs.stdenv, python27 ? pkgs.python27, fetchFromGitHub ? pkgs.fetchFromGitHub,
virtualenv ? pypkg.virtualenv, pip ? pypkg.pip, setuptools ? pypkg.setuptools }:
let
inherit (pkgs.lib) concatMapStringsSep mapAttrsToList concatStringsSep;
deps = {
# the script fetches two other repos from github
@yorickvP
yorickvP / Makefile.agricraft
Last active April 3, 2016 18:14
let's do some crop mutations
WateringCan: | Kiwi Beet Corn
Pumpkin: | Carrot Potato
Sugarcane: | Carrot Wheat
Melon: | Carrot Pumpkin
Dandelion: | Melon Sugarcane
Poppy: | Pumpkin Sugarcane
BlueOrchid: | Poppy Dandelion
Daisy: | BlueOrchid Dandelion
Allium: | BlueOrchid Poppy
import Data.List
-- import Debug.Trace
data Node a = DeadEnd a
| Passage a (Node a)
| Fork a (Node a) (Node a)
instance (Show a) => Show (Node a) where
show (DeadEnd a) = "DeadEnd " ++ show a
show (Passage a _) = "Passage " ++ show a
show (Fork a _ _) = "Fork " ++ show a
-- shiny and exciting O(n log n) algorithm
-- the n parameter and the idea to use something like merge sort is from Bird
-- both of those things are really clever
join :: Ord a => Int -> [(a, Int)] -> [(a, Int)] -> [(a, Int)]
join 0 ax [] = ax -- n corresponds to length b, so if b is empty n = 0
join n [] bx = bx
-- something like merge sort but slightly different
join n ax@((a, ac):as) bx@((b, bc):bs)
| a < b = (a, ac + n) : join n as bx
@yorickvP
yorickvP / rps.js
Created January 15, 2013 01:13
rock paper scissors for more than 2 players and extensible
function RPS(noPlayers, proto) {
var obj = Object.create(proto || RPS.prototype)
obj.players = noPlayers
obj.score = {}
obj.moves = {}
for (var i = 0; i < noPlayers; i++) {
obj.score[i] = 0
obj.moves[i] = [] }
return obj }
@yorickvP
yorickvP / thankstome.user.js
Created January 15, 2013 00:05
warn when you're about to tweet "thanks to me"
// ==UserScript==
// @name Warn when you're about to tweet "thanks to me"
// @namespace http://localhost/
// @version 0.1
// @description Add an alert whenever someone types "thanks to me"
// @match http://twitter.com/*
// @match https://twitter.com/*
// ==/UserScript==
(function() {
@yorickvP
yorickvP / shutdowner.js
Created November 3, 2012 11:29
Shut down servers nicely
// keeps track of connections to a http server and closes them when the server closes.
function LinkedList() {
this.start = null
this.end = null }
LinkedList.prototype.add = function(data) {
var ref = { data: data, next: null, prev: null }
if (!this.start) this.start = ref
if (this.end) {