Skip to content

Instantly share code, notes, and snippets.

View rbucker's full-sized avatar

richard bucker rbucker

View GitHub Profile
@rbucker
rbucker / gist:1665608
Created January 23, 2012 21:25
The is the sample SQL for implementing crud-fest
-- Copyright (c) 2012 - Richard Bucker
-- All Rights Reserved
--
-- this file/script will create the necessary tables
-- in the database as part of the crud_fest project.
--
-- NOTE: the initial testing is being performed against
-- a SQLite3 instance, however, in order to test Grails
-- I'll be executing this code against H2.
--
@rbucker
rbucker / combo.pl
Created June 4, 2012 17:44
given a set of weighted values what combination(s) equal 10?
#!/usr/bin/env perl
use strict;
use warnings;
use Math::BigInt;
use List::Util qw(first max maxstr min minstr reduce shuffle sum);
my %d = ("apple"=>3, "pear"=>2, "pineapple"=>9, "strawberry"=>1,
"kiwi"=>-5, "lime"=>15, "lemon"=>5, "orange"=>-1, "banana"=>5);
@rbucker
rbucker / combo2.pl
Created June 4, 2012 20:29
slightly refactored version of the same code less side effects.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Math::BigInt;
use List::Util qw(first max maxstr min minstr reduce shuffle sum);
use List::MoreUtils qw( pairwise );
my $t = 10;
@rbucker
rbucker / combo3.pl
Created June 5, 2012 16:32
remove my xdump() and replace with Data::Dumper
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Bit::Vector::Overload;
use List::Util qw(first max maxstr min minstr reduce shuffle sum);
use List::MoreUtils qw( pairwise );
my $target_sum = 10;
package main
import fmt
func main() {
fmt.Println("hello")
}
This page is going to hold my default NixOS config for idempotent installations.
@rbucker
rbucker / make.go
Last active August 29, 2015 14:14
/* Copyright 2015, One Off Code
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
package main
import "fmt"
func main() {
fmt.Printf("Hello")
}
$ dig localhost
; <<>> DiG 9.10.2-P2 <<>> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12449
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
@rbucker
rbucker / ,
Last active November 3, 2015 14:56
HelloWorldCompute.xlsx