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
| import random | |
| class RedisDisjointSet(object): | |
| """ | |
| https://en.wikipedia.org/wiki/Disjoint-set_data_structure | |
| UTF-8 based persistent disjoint set structure that just assumes there's a local redis | |
| """ | |
| def __init__(self, seed=None): |
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
| echo "echo 'sleep 1' >> ~/.profile" >> ~/.profile |
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
| create table penglish_scratch.naics_desc_lookup ( | |
| code varchar(6) sortkey distkey, | |
| description varchar(255) | |
| ); | |
| insert into penglish_scratch.naics_desc_lookup values | |
| ('11', 'Agriculture, Forestry, Fishing and Hunting'), | |
| ('111', 'Crop Production'), | |
| ('1111', 'Oilseed and Grain Farming'), |
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
| from lark import Lark | |
| l = Lark(''' | |
| ?start: elixir_item | json_value | xml | node | |
| /////////////////////// | |
| // JSON | |
| ?json_value: json_object | |
| | json_array |
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
| import requests | |
| from slackclient import SlackClient | |
| DAYS = 1 | |
| FTL_URL = "https://backend.thefoodtruckleague.com/events/?days=%s&name=" % DAYS | |
| SLACK_TOKEN = "" | |
| def post_food_trucks_for_the_day(): | |
| sc = SlackClient(SLACK_TOKEN) |
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
| var g = 7; | |
| var p = [ | |
| 0.99999999999980993, | |
| 676.5203681218851, | |
| -1259.1392167224028, | |
| 771.32342877765313, | |
| -176.61502916214059, | |
| 12.507343278686905, | |
| -0.13857109526572012, | |
| 9.9843695780195716e-6, |
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
| CREATE FUNCTION levenshtein(s1 varchar, s2 varchar) RETURNS integer IMMUTABLE AS $$ | |
| import numpy as np | |
| # https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Python | |
| def levenshtein(source, target): | |
| source = source or "" | |
| target = target or "" | |
| if len(source) < len(target): | |
| return levenshtein(target, source) |
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
| import random | |
| import numpy as np | |
| from sacred import Experiment | |
| ex = Experiment() | |
| @ex.config | |
| def config(): | |
| n_sims = 1000 |
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
| set nocompatible | |
| filetype on "make sure it's on first, otherwise bad exit code | |
| filetype off "Required for Vundle | |
| " Using vundle | |
| " Install with git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
| set rtp+=~/.vim/bundle/vundle | |
| call vundle#begin() |
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 | |
| # !/usr/bin/env python | |
| from __future__ import division, print_function | |
| import random | |
| import sys | |
| from datetime import datetime | |
| import numpy as np | |
| import slackweb |