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
(strptime("%Y-%m-%d") | mktime | strftime("%Y-%m-01") | strptime("%Y-%m-%d") | mktime | todate) |
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
Can we implement all of these algorithms? | |
Similarity Algorithms: | |
- Cosine | |
- Fuzzy Wuzzy | |
- Jaccard | |
- Jaro | |
- Jaro Winkler | |
- Q-gram | |
- Sørensen DIce |
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 python | |
"""yaml2json: Compact script for yaml to json conversion""" | |
import yaml | |
import json | |
import sys | |
args = [open(x,'r') for x in sys.argv[1:]] | |
args = [sys.stdin.read(), *args] if not sys.stdin.isatty() else args | |
files = [yaml.safe_load(y) for y in args] |
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/sh | |
# yaml2json | |
cat myFile.yml | python -c 'import yaml; import json; import sys; f = sys.stdin.read(); conf = yaml.safe_load(f); out = json.dumps(conf, separators=(",",":")); print(out)' |
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
split("\n") | |
| ( | |
.[0] | |
| split(",") | |
) as $head | |
| .[1:] | |
| map | |
( | |
split(",") | |
| to_entries |
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
// Google Activity URL: https://pay.google.com/gp/w/u/0/home/activity | |
// add the id `x-payments-hist` to the tbody | |
// containing the payments after viewing | |
// all records (i.e. it says "No more transactions") | |
let payments = []; | |
let rows = document.querySelectorAll("#x-payments-hist > tr"); | |
rows.forEach(function(node) { | |
let r = {}; |
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
import subprocess | |
import json | |
def applyjqtxt(filter, text): | |
echo = subprocess.Popen(('echo', text), stdout=subprocess.PIPE) | |
output = subprocess.check_output(('jq', filter), stdin=echo.stdout) | |
echo.wait() | |
return output | |
def applyjq(filter, data): |
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
const isNotANumber = (v) => { | |
const n = Number(v); | |
return n !== n; | |
} | |
export default isNotANumber; |
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 python | |
# -*- coding: utf-8 -*- | |
# | |
# SPDX-License-Identifier: MIT | |
# | |
""" Calculate the probability of atleast one match after x tries""" | |
from __future__ import print_function | |
import argparse |
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
co3325 | |
co3326 | |
co3354 | |
co3355 |
NewerOlder