This file contains hidden or 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 python | |
# Python version of https://gist.github.com/petdance/a147f8da9d2afde593382321c07dd2d1 | |
import csv | |
import string | |
def create_sql(): | |
return ''' | |
DROP TABLE IF EXISTS response; | |
DROP TABLE IF EXISTS reasons; |
This file contains hidden or 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 warnings; | |
use strict; | |
use 5.010; | |
use Text::CSV_XS; | |
my $csv = Text::CSV_XS->new; |
This file contains hidden or 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
/* The MariaDB I installed doesn't support CTEs, so use a subquery */ | |
SELECT * FROM ( | |
select | |
reason, | |
SUM( CASE WHEN gender = 'Male' THEN 1 END) as M, | |
SUM( CASE WHEN gender = 'Female' THEN 1 END) as F, | |
SUM( CASE WHEN gender NOT IN ('Male','Female') THEN 1 END) AS X, | |
COUNT(gender) AS T | |
from response | |
inner join reasons on reasons.responseid = response.responseid |
This file contains hidden or 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/perl | |
use warnings; | |
use strict; | |
use 5.010; | |
use List::Util qw( sum ); | |
my $score = 0; |
This file contains hidden or 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
This update to my syntax/perl.vim made auto indenting break. | |
If I type | |
sub foo { | |
and then hit return, the cursor used to move to the next line and be indented 4 spaces. This is no longer the case. | |
Index: syntax/perl.vim | |
=================================================================== |
This file contains hidden or 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
# Install Homebrew. | |
$ su ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Show brew's commands. | |
$ brew help | |
# Check current user. | |
$ echo $(whoami) | |
# Grant access to the folders. |
This file contains hidden or 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
$ cat prototypes-timings.pl | |
#!/var/perl/bin/perl | |
use warnings; | |
use strict; | |
use 5.020; | |
no warnings 'experimental::signatures'; | |
use feature 'signatures'; |
This file contains hidden or 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
Category Pri Due Task | |
Writing A Jul 1 Finish Esther article | |
Bills A Financial spreadsheet | |
Blog A Article: vim templates | |
ackbook A Jul 8 Start chapter 4 | |
Bills B Renew passport | |
Career C Machine learning 101 slides | |
Open source C Kill dead POD policy in Perl::Critic | |
# unprioritized & dated |
This file contains hidden or 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
TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN | |
0.089719 2504 66 0.001406 0.000036 perlMatch \%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@! | |
0.073028 2964 526 0.000167 0.000025 perlString \I\@<!-\?\I\i*\%(\s*=>\)\@= | |
0.039462 5639 3214 0.000037 0.000007 perlVarPlain \%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\) | |
0.023359 2438 0 0.000042 0.000010 perlStatementPword \<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\> | |
0.020884 2864 440 0.000037 0.000007 perlStatementProc \<\%(plan\|use_ok\|require_ok\|ok\|is\|isnt\|diag\|explain\|note\|like\|unlike\|cmp_ok\|is_deeply\|skip\|can_ok\|isa_ok\|pass\|fail\|BAIL_OUT\|subtest\)\> | |
0.017876 2482 50 0.000091 0.000007 perlStatementIndirObjWrap \%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={ | |
0.015173 2454 16 0 |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> </title> | |
</head> | |
<body> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.5.2/css/tabulator.min.css" rel="stylesheet"> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.5.2/js/tabulator.min.js"></script> | |
<div> | |
START OF TABLE |