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
-- see if the file exists | |
function file_exists(file) | |
local f = io.open(file, "rb") | |
if f then f:close() end | |
return f ~= nil | |
end | |
-- 1. Replaces .md with .html | |
-- 2. Replaces absolute paths with relative ones | |
-- 3. Replaces folder links with links to their index / readme |
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
-- calculate td/idf | |
create or replace view scratch.v_elt_calculate_tf_idf | |
as | |
with | |
params as ( | |
select 3 as MIN_TOK, | |
5 as MAX_RNK, | |
CURRENT_DATETIME() as added_ts, | |
100 as MIN_TF | |
), |
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
#!/bin/sh | |
PATH="$PATH:/usr/local/bin" | |
export LC_CTYPE=C | |
export LC_COLLATE=C | |
# decode URL encoded $1 and print result to stdout | |
urldecode() { | |
gawk "BEGIN { print \"$(echo "$1" | sed -e 's/"/\\"/' -e 's/+/ /g' -e 's/%/\\x/g')\" }" </dev/null | |
} |
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
#!/bin/bash -eu | |
# Client script to pull Yahoo Finance historical data, off of its new cookie | |
# authenticated site. Start/End Date args can be any GNU readable dates. | |
# Script requires: GNU date, curl and bash shell | |
symbol=$1 | |
startDate=$2 | |
endDate=$3 |
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 strict; | |
use warnings FATAL => 'all'; | |
use English qw(-no_match_vars); | |
use Lingua::EN::Fathom; | |
use TeX::Hyphen; | |
use List::Util qw(min); |