Skip to content

Instantly share code, notes, and snippets.

@MyriaCore
MyriaCore / fix-links.lua
Last active February 15, 2024 11:39
How to use pandoc with gitlab markdown
@sanealytics
sanealytics / tf_idf.sql
Created January 7, 2020 04:43
TF/IDF in Bigquery SQL
-- 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
),
@clausecker
clausecker / locate.sh
Last active April 8, 2021 22:19
locate(1) as a CGI script
#!/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
}
@Mister-Meeseeks
Mister-Meeseeks / pullYahoo.sh
Created May 17, 2017 21:45
Bash script for Yahoo Finance historical data. Works with new cookie-based authentication
#!/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
#!/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);