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
#!/bin/env node | |
// Jack Morris 06/26/16 | |
var express = require('express'); | |
var fs = require('fs'); | |
var App = function() { | |
// Scope. | |
var self = this; |
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
# needs python 3.5+ | |
import glob | |
import os | |
def sh_escape(s): | |
return s.replace("(", "\\(").replace(")","\\)").replace(" ","\\ ") | |
home = '/Users/myusername' | |
glob_path = home + '/Library/Messages/Attachments/**/*' |
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/local/bin/python3 | |
# | |
# written 8/2/19 by jxm | |
# | |
# For some reason Chrome has its own DNS cache that makes websites | |
# still accessible sometimes after DNS is enabled. I considered adding | |
# code in this script to force-restart Chrome, but I'm going to forgo | |
# that for now until I find a better way to edit Chrome's settings | |
# to disable DNS caching. (Or just use Firefox...) | |
# |
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
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
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
git rev-list --all --objects | \ | |
sed -n $(git rev-list --objects --all | \ | |
cut -f1 -d' ' | \ | |
git cat-file --batch-check | \ | |
grep blob | \ | |
sort -n -k 3 | \ | |
tail -n40 | \ | |
while read hash type size; do | |
echo -n "-e s/$hash/$size/p "; | |
done) | \ |
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 | |
# jm8wx 11/2/20 | |
import subprocess | |
import re | |
airpods_name = "Jack’s AirPods Pro" | |
def _color(s): | |
return "\033[94m" + s + "\033[0m" |
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
OBJS = \ | |
bio.o\ | |
console.o\ | |
exec.o\ | |
file.o\ | |
fs.o\ | |
ide.o\ | |
ioapic.o\ | |
kalloc.o\ | |
kbd.o\ |
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
Python | |
map a function to a list: — map (f, list) — NOT the other way around | |
set a breakpoint: import pdb; pdb.set_trace() | |
—> ACTUALLY starting in python 3.7 you can just do breakpoint() ! | |
best way to profile any python code: pip install pyinstrument; python -m pyinstrument ./myprog.py | |
run a pytest test by pattern: pytest -k <pattern> |
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
from typing import Dict, Tuple | |
import logging | |
import os | |
import pathlib | |
import requests | |
import zipfile | |
import beir | |
import beir.datasets |
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 argparse | |
import glob | |
import datasets | |
import pandas as pd | |
def load_datasets(data_folder): | |
train_file = glob.glob(f"{data_folder}/train*.jsonl")[0] | |
test_file = f"{data_folder}/test.jsonl" | |
dev_file = glob.glob(f"{data_folder}/dev*.jsonl")[0] |
OlderNewer