Skip to content

Instantly share code, notes, and snippets.

View chapmanjacobd's full-sized avatar
🥅
goal_net

Jacob Chapman chapmanjacobd

🥅
goal_net
View GitHub Profile
@chapmanjacobd
chapmanjacobd / test.csv
Last active April 5, 2020 00:25
distinct areas test data
X Y id
12.5132783 41.9042869 246571139
12.5162428 41.9047904 246571141
12.5008587 41.9031875 246571142
12.5147289 41.8882923 246572369
12.5133898 41.8896867 246572370
12.5055161 41.8938436 246572372
12.5055930 41.8939226 246572374
12.5031139 41.8953371 246574144
12.5030480 41.8952766 246574145
@chapmanjacobd
chapmanjacobd / keybindings.json
Created April 15, 2020 04:21
vs code ctrl-tab across groups
[
{
"key": "ctrl+tab",
"command": "workbench.action.quickOpenPreviousRecentlyUsedEditor"
},
{
"key": "ctrl+tab",
"command": "workbench.action.acceptSelectedQuickOpenItem",
"when": "inEditorsPicker && inQuickOpen"
},
@chapmanjacobd
chapmanjacobd / music.md
Last active February 4, 2022 06:16
minimalist music player
~ $ type mp
mp is a function with definition
function mp
    mpv --input-ipc-server=/tmp/mpvsocket --shuffle --no-video /home/xk/Music/
end
@chapmanjacobd
chapmanjacobd / random-shell-prompt.md
Last active April 18, 2020 08:41
random shell prompt character

in ~/.config/fish/functions/fish_prompt.fish

replace

set suffix "$"

with

@chapmanjacobd
chapmanjacobd / .bashrc
Created April 23, 2020 03:28
tmux start on login .bashrc
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec $(tmux a -t base || tmux new -s base)
fi
@chapmanjacobd
chapmanjacobd / sample_music.ts
Last active April 29, 2020 12:30
nothin' good on the radio simulator
import { writeFileSync } from "fs";
const numberOfSongs = process.argv.slice(2).length;
const randomFile = process.argv
.slice(2)
.map((x) => ' -i "' + x + '" \\\n')
.join("");
function rndInt(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1)) + min;
@chapmanjacobd
chapmanjacobd / mpv
Last active January 5, 2022 17:00
set mpv stereo to mono
# ~/.config/mpv/input.conf
- af toggle "lavfi=[pan=1c|c0=0.5*c0+0.5*c1]" ; show-text "Audio mix set to Mono"
= af toggle "lavfi=[alimiter=10:1:1:5:8000]" ; show-text "Audio limiter enabled"
Ctrl+= af toggle "acompressor=ratio=4,loudnorm" ; show-text "dynamic range compression enabled"
Ctrl+0 af toggle "pan=stereo|FL=FC+0.30*FL+0.30*FLC+0.30*BL+0.30*SL+0.60*LFE|FR=FC+0.30*FR+0.30*FRC+0.30*BR+0.30*SR+0.60*LFE" ; show-text "Audio night-mode enabled"
@chapmanjacobd
chapmanjacobd / xml.R
Last active May 28, 2020 04:28
R XML
xpathApply(doc, "//*", xmlAttrs)
xml_find_all(order1xml, "//*")
xml_attrs(xml_find_all(order1xml, "//*")[2])
xml_find_all(xml_doc, xpath = "/response/orderstatus/order/fixmlmessage")
@chapmanjacobd
chapmanjacobd / buy.js
Last active June 3, 2020 04:55
Ally Invest stonks (limit order)
// MIT License
// Jacob Chapman
var oauth = require("oauth");
// Setup key/secret for authentication and API endpoint URL
var configuration = {
api_url: "https://api.tradeking.com/v1",
consumer_key: "################",
consumer_secret: "################",
access_token: "################",
@chapmanjacobd
chapmanjacobd / might_be_helpful_4_u.R
Created June 7, 2020 02:32
Ally Invest xml decoding R
require(httr)
require(RJSONIO)
require(glue)
require(xml2)
require(data.table)
require(tibble)
orders <- jsonlite::fromJSON((credentials$OAuthRequest("https://api.tradeking.com/v1/accounts/xxxxxxxx/orders.json")))$response$orderstatus$order