Skip to content

Instantly share code, notes, and snippets.

View sparr's full-sized avatar

Clarence "Sparr" Risher sparr

  • Estate of Mind
  • Northbridge MA USA
View GitHub Profile
@sparr
sparr / gist:9875737
Last active August 29, 2015 13:57
one bitflip per increment
A binary numerical encoding wherein sequential integers only differ from each other
by a single bit. I'm calling this "one bitflip per increment" encoding. This is my
proposal to a question posed on the Artisan's Asylum discussion mailing list, with
the topic being looking for numerical encodings that are friendly to possibly-genetic
algorithmic solutions to problems where only bitwise operations are used, and thus
finding a solution of "10000" from "01111" is unlikely, while finding "10000" from
"10001" is easy. The nth lsbit of the mask flips every 2^n increments.
bin | obpi | mask
0000 | 0000 | 0000
@sparr
sparr / gist:8409141
Last active January 3, 2016 04:29
depluralize mediawiki template parameter
{{#sub:{{lc: {{{1}}} }}|0|-3}}{{#ifeq:
{{#sub:
{{lc: {{{1}}} }}|
-3
}}|
men|
man|
{{#ifeq:
{{#sub:
{{lc: {{{1}}} }}|
@sparr
sparr / sched_to_guidebook_exhibitors_csv.pl
Last active December 26, 2015 11:19
convert sched.org vendor list exported csv to guidebook exhibitor list importable csv
#!/usr/bin/perl
use Text::CSV;
my @rows;
my $csv = Text::CSV->new ( { binary => 1 } ) # should set binary attribute.
or die "Cannot use CSV: ".Text::CSV->error_diag ();
# discard metadata non-rows
<>; # Sched: [nameoflist],Downloaded on 1999-09-09 9:09:09 pm,,,,,,,,,,
@sparr
sparr / gist:7030099
Created October 17, 2013 18:46
NECTR packing list
PACK:
home
air mattress
sleeping bag
blankets
rope
toys
clothes
camera
generator
@sparr
sparr / gist:6287686
Last active December 21, 2015 09:49
testing gnu grep 2.5.1 for matching leading unescaped curly braces
sparr$ grep --version
grep (GNU grep) 2.5.1
Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sparr$ echo "foo { bar" | grep "{"
foo { bar
sparr$ echo "foo { bar" | grep -E "{"
@sparr
sparr / cobblerd_set_date.snippet
Created August 14, 2013 21:06
cobblerd snippet to set the date and time via kickstart %pre
# set the date and time
#import time
#set $timestamp = $time.strftime("%m%d%H%M%Y.%S",$time.gmtime());
date -u $timestamp
hwclock -w -u
@sparr
sparr / git remote -v
Created August 5, 2013 19:17
`git remote -v` while troubleshooting ruby instructions
origin [email protected]:sparr/ruby.git (fetch)
origin [email protected]:sparr/ruby.git (push)
upstream git://github.com/ruby/ruby.git (fetch)
upstream git://github.com/ruby/ruby.git (push)
@sparr
sparr / fb_list_edit_profile_links.js
Last active December 18, 2015 16:49
Add profile links to Facebook friend list management
<!DOCTYPE html>
<html lang="en">
<!--
One Page HTML/CSS resume design, copyright 2013 Nicholas Perry.
Structure and design of HTML and CSS released under Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/deed.en_US
Personal Content is used as exmaple, but is not licensed for re-use, please update all content (including meta tags) before republish/reuse.
For inquerys, contact nicholas.t.perry at gmail.com and refer to this gist: https://gist.github.com/4509098.
Please do not remove this copyright notice and include a note on modifications if you choose to use this for your own resume.
-->
@sparr
sparr / gist:5265567
Created March 28, 2013 18:17
ohai output on OSX 10.7, lightly censored
{
"counters": {
"network": {
"interfaces": {
"en1": {
"rx": {
"bytes": "19949649885",
"packets": "19418063",
"overrun": 0,
"multicast": 0,