Skip to content

Instantly share code, notes, and snippets.

View sitch's full-sized avatar

Sitch sitch

View GitHub Profile
defmodule Decimal.Prefix do
defmacro __using__(_args) do
quote do
import Decimal.Prefix, only: [decimal: 1]
end
end
def overrides, do: ["+": 2, "-": 2, "*": 2, "/": 2]
\documentclass[11pt, oneside]{article}
\usepackage[margin=0.5in]{geometry}
\geometry{letterpaper}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{xcolor}
\pagecolor{white}
\usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue]{hyperref}
\pagestyle{empty}
import time
import torch
from transformers import GPT2LMHeadModel, GPT2Tokenizer
start = time.time()
device = torch.device("cuda")
tokenizer = GPT2Tokenizer.from_pretrained("stanford-crfm/pubmed_gpt_tokenizer")
@sitch
sitch / dotfiles-manjaro-install.sh
Last active January 14, 2021 19:28
Install `dotfiles-manjaro`
git clone --bare git@github.com:sitch/dotfiles-manjaro.git $HOME/.dotfiles
function dot {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
dot checkout
if [ $? = 0 ]; then
echo "Checked out dotfiles-manjaro.";
else
echo "Backing up pre-existing dot files.";
@sitch
sitch / plaid_transaction.json
Last active December 10, 2020 14:31
Sample Json for OCR receipt output (https://www.veryfi.com/receipt-ocr-api/) and Plaid Transaction (https://plaid.com/docs/transactions/)
{
"account_id": "BxBXxLj1m4HMXBm9WZZmCWVbPjX16EHwv99vp",
"amount": 2307.21,
"iso_currency_code": "USD",
"unofficial_currency_code": null,
"category": ["Shops", "Computers and Electronics"],
"category_id": "19013000",
"date": "2017-01-29",
"authorized_date": "2017-01-27",
"location": {
.editable-cell {
position: relative;
}
.editable-cell-value-wrap {
padding: 5px 12px;
cursor: pointer;
}
.editable-row{
import React from "react"
import PropTypes from "prop-types"
import { connect } from "dva"
import { Form, Table } from "antd"
import { indicator, styles as tableStyles } from "dva-table-helpers"
// import { url } from "dva-route-helpers"
import classnames from "classnames"
import { EditableCell, EditableRow } from "dva-table-helpers"
import styles from "dva-table-helpers/EditableTable.less"
import React from "react"
import PropTypes from "prop-types"
import { Table, Input, Button, Popconfirm, Form } from "antd"
import styles from "./EditableTable.less"
const FormItem = Form.Item
const EditableContext = React.createContext()
const EditableRow = ({ form, index, ...props }) => (
@sitch
sitch / launch-rserve.R
Created May 8, 2015 16:25
RServe Startup (Add launch-rserve.sh to login items on OSX)
library(Rserve);
Rserve(args="--vanilla");