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 boto3 import session | |
from botocore.client import Config | |
import os | |
import os.path | |
from collections import namedtuple | |
class Space: | |
def __init__(self, region_name, endpoint_url, aws_access_key_id, aws_secret_access_key, bucket_name): | |
self._sess = session.Session() | |
self._client = self._sess.client( |
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
@-moz-document domain("app.qbo.intuit.com") { | |
/* ==UserStyle== | |
@name 4/17/2023, 6:33:24 PM | |
@namespace github.com/openstyles/stylus | |
@version 1.0.0 | |
@description QuickBooks Online - Compact and Legible | |
@author phrz | |
==/UserStyle== */ | |
/* hide unused sidebar items */ |
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 decimal | |
Decimal = decimal.Decimal | |
def split_amount(dec, n): | |
splits = [(dec/Decimal(n)).quantize(Decimal('0.01'), decimal.ROUND_DOWN)]*n | |
while (error_cents := int((dec - sum(splits)) * 100)) != 0: | |
for i in range(error_cents): | |
splits[i] += Decimal('0.01') | |
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
def cache_to_file(file_name): | |
def decorator(f): | |
try: | |
cache = json.load(open(file_name, 'r')) | |
except (IOError, ValueError): | |
cache = {} | |
def new_func(*args, **kwargs): | |
cache.update({ps:f(*args,**kwargs)}) if (ps := param_string(args, kwargs)) not in cache else (json.dump(cache, open(file_name, 'w'))) | |
return cache[ps] | |
return new_func |
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
[ | |
{ | |
"title" : "Model Rules of Professional Conduct", | |
"shortcuts" : [ | |
"mrpc" | |
], | |
"mobile" : "https:\/\/www.americanbar.org\/search\/?q=%s&hl=on&hl.fl=title%2Cdescription&wt=json&start=0&rows=10&fq=(id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fgroups%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fadvocacy%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Ftopics%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fproducts%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fevents-cle%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fnews%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fmembership%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Fcareercenter%2F*%20OR%20id%3A%5C%2Fcontent%2Faba-cms-dotorg%2Fen%2Finitiatives%2F*%20OR%20id%3A%5Chttp%5C%3A%2F%2Fwww.abajournal.com%2F*%20OR%20id%3A%5C%2Fcontent%2Fdam%2Faba%2Fpublications%2F*%20OR%20id%3A%5C%2Fcontent%2Fdam%2Faba%2Fpublishing%2F*)&defType=edismax&mm=75%25&fl=id%3Aid%2Cscore%3Ascore%2Ctitle%3Atitle_s%2Cde |
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 time | |
print('SCHEDULE ENTRY', '='*50, sep='\n') | |
print('[Input schedule lines "HHMM <task>". Ends when <task> is "end"]\n') | |
sums = {} | |
last_start = None | |
t = lambda s: int(s[:2])*60*60 + int(s[2:4])*60 # HHMM to seconds since previous 00:00 | |
while True: |
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
#include <fstream> | |
#include <iostream> | |
#include <array> | |
// creates a new instance of the type | |
// and reads data into it. Good for single | |
// value types. | |
template<typename T> | |
T STLParser::readBinary(std::ifstream& ifs) { | |
T 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
% !TEX TS-program = XeLaTeX | |
% DOCUMENT FORMATTING | |
\documentclass[12pt]{article} | |
\usepackage{fullpage} | |
\usepackage{fancyhdr} % better looking title | |
\usepackage[all]{nowidow} | |
% MATH FORMATTING | |
\usepackage{amsmath} |
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
# You need this: git/contrib/completion/git-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
source ~/.git-prompt.sh | |
export PS1='\[\033[38;5;9m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;14m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]$(__git_ps1 ":git<%s>"):\\$ \[$(tput sgr0)\]' | |
alias aplay="mplayer -cache 1024 -really-quiet -rawaudio samplesize=1:channels=1:rate=8000 -demuxer rawaudio -" | |
# You need the version of LLVM that haskell wants installed, `brew install llvm@__`. |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Tron Color Scheme/Tron.tmTheme", | |
"drag_text": false, | |
"draw_white_space": "all", | |
"font_face": "FiraCode-Regular", | |
"font_size": 15, | |
"ignored_packages": | |
[ | |
"Vintage" |
NewerOlder