This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"regexp" | |
"strconv" | |
"strings" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+{ | |
mysql => { | |
user => 'volt', | |
password => 'voltisfast', | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!) | |
* but the usual tools were hitting the memory limit pretty quick. I found that | |
* manually parsing the XML worked pretty well. Note that this, most likely, | |
* won't work if cells contain anything more than text or a number (so formulas, | |
* graphs, etc ..., I don't know what'd happen). | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use DBI; | |
my $data_source = 'dbi:mysql:database=foo;host=localhost;mysql_socket=/var/run/mysql5/mysqld.sock'; | |
my $username = 'bar'; | |
my $auth = ''; | |
my $dbh = DBI->connect($data_source, $username, $auth); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |