Skip to content

Instantly share code, notes, and snippets.

View ysangkok's full-sized avatar

Janus Troelsen ysangkok

View GitHub Profile
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "your-program-${version}";
version = "1.2.3";
src = fetchurl {
url = "https://your-program.com/download/v${version}.tar.gz";
sha256 = "05s3kvsz6pzh4.......lqwg0qn0ljz58sdqh";
};
@ysangkok
ysangkok / smallqm.js
Created June 4, 2013 16:06
Quine-McCluskey in JavaScript
"use strict";
// from http://stackoverflow.com/a/11454049/309483
var combine = function (m, n) {
var a = m.length, c = '', count = 0, i;
for (i = 0; i < a; i++) {
if (m[i] === n[i]) {
c += m[i];
} else if (m[i] !== n[i]) {
@teh
teh / avahi_publish.py
Created June 8, 2012 08:41
avahi publish
#! /usr/bin/env python
# avahi-alias.py
import avahi, dbus
from encodings.idna import ToASCII
import logging
# Got these from /usr/include/avahi-common/defs.h
CLASS_IN = 0x01
TYPE_CNAME = 0x05
@klange
klange / image-to-ansi.py
Created January 27, 2012 06:29 — forked from MicahElliott/colortrans.py
Convert images to ANSI escape sequences
#! /usr/bin/env python
""" Convert an image (argv[1]) to an ANSI text string (xterm-256color)
Original readme from colortrans.py follows:
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources: