Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import serial # pyserial
import fileinput
serial_opts = {
# built-in serial port is "COM1"
# USB serial port is "COM4"
"port": "COM1",
"baudrate": 9600,
"parity": serial.PARITY_EVEN,
@neckro
neckro / jenkins.js
Created July 9, 2015 19:55
Jenkins builder thing
var request = require('https').request;
var querystring = require('querystring');
// logging
var format = require('util').format;
var log = require('util').log;
var _ = require('lodash');
var Promise = require('bluebird');
@neckro
neckro / pl.php
Created September 2, 2014 20:03
MP3 playlist generator
<?php
class Config {
public static $MusicFolder = "music";
public static $MusicTypes = array("mp3", "mpeg3", "flac", "m4a", "aiff");
public static $FolderImage = array("folder.jpg", "folder.png", "folder.gif");
public static $AllowSymlinks = false;
}
$baseurl = explode("?", "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);

Keybase proof

I hereby claim:

  • I am neckro on github.
  • I am neckro (https://keybase.io/neckro) on keybase.
  • I have a public key whose fingerprint is C085 DF2B 8626 AB22 1BE5 9B68 2770 F2A3 7EF1 9C55

To claim this, I am signing this object:

This file has been truncated, but you can view the full file.
Chop, chop, Dad! Let's get a move on! The last time I was late for the farmer's market, I got the worst of the squash blossoms.
What?!
Oh, dear lord, give it here.
Two bags of chips, three puddin' cups, and a root beer.
A, this is not a lunch, and B, I fail to see how it took you so long since you did not make anything but simply transferred smaller containers into a larger one. Let's go!
Hi.
Oh...
What's going on?
Well, thank goodness.
Why?! If we had missed your wedding, well it would have just killed me.
@neckro
neckro / git-nuke.sh
Created January 1, 2014 01:51
only way to be sure.
#!/bin/bash
default_branch="master"
repo_dir="$HOME/www"
branch=$1
[ -z "$branch" ] && branch="$default_branch"
cd $repo_dir
git fetch
git clean -fd
@neckro
neckro / octosave.json
Last active December 25, 2015 08:19
octotrog.js save file for crawl 0.13 tourney
{
"teams": {
"Potion of Beneficial MeFitation": [
"slitherrr",
"256",
"murphyslaw",
"odiv",
"thenoid",
"zureal"
],
/* Runs a stochastic dither animation on an 8x8 LED matrix.
23 December 2011 - neckro@gmail.com - No license. Do what thou wilt.
Requires a Maxim MAX7221 or MAX7219 LED controller.
Also requires LedControl library: http://www.arduino.cc/playground/Main/LedControl
Fills a row's array proportional to its distance from origin,
then applies a Fisher-Yates shuffle to randomize the order.
*/
#include <LedControl.h>
@neckro
neckro / git-scp.sh
Last active December 23, 2015 12:59
Lazy dev script. Quickly copy your files since whatever Git revision to remote server.
#!/usr/bin/env sh
IFS=$'\n'
export dest=$1
revision=$2
default_revision="HEAD~1"
function tar_upload() {
local server=${dest%:*}
local remote_dir=${dest#*:}
sed -e 's/^.*-\> //g' |\
@neckro
neckro / svg.js
Last active December 23, 2015 11:38
diy SVG library
// SVG helpers
define([], function() { "use strict";
///////////////////////
var Svg = (function(svg) {
svg.ns = {
svg: 'http://www.w3.org/2000/svg',
xlink: 'http://www.w3.org/1999/xlink'
};
svg.create = function() {