Skip to content

Instantly share code, notes, and snippets.

View jjthrash's full-sized avatar

Jimmy Thrasher jjthrash

View GitHub Profile
@jjthrash
jjthrash / workflow.md
Last active October 3, 2019 12:34
Converting Essays to MP3 #personal
  • View webpage in reader view
  • Copy to a text file
  • Remove pull quotes and other junk
  • essay-to-mp3 textfile.txt
  • id3v2 -t "Title of essay" -a "Publication" file.mp3

essay-to-mp3

Does this:

@jjthrash
jjthrash / links.md
Last active October 11, 2021 17:39
MyNoise links #pinned
@jjthrash
jjthrash / resistor-ratios.csv
Last active August 18, 2017 12:18
Don't know if there's a different way to do this, but I'm using it as an electronics beginner to determine what Rf and R1 values I can use to achieve certain op-amp configurations.
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 25 columns, instead of 13. in line 7.
,10,11,12,13,15,16,18,20,22,24,27,30,33,36,39,43,47,51,56,62,68,75,82,91
10,1.000,0.909,0.833,0.769,0.667,0.625,0.556,0.500,0.455,0.417,0.370,0.333,0.303,0.278,0.256,0.233,0.213,0.196,0.179,0.161,0.147,0.133,0.122,0.110
11,1.100,1.000,0.917,0.846,0.733,0.688,0.611,0.550,0.500,0.458,0.407,0.367,0.333,0.306,0.282,0.256,0.234,0.216,0.196,0.177,0.162,0.147,0.134,0.121
12,1.200,1.091,1.000,0.923,0.800,0.750,0.667,0.600,0.545,0.500,0.444,0.400,0.364,0.333,0.308,0.279,0.255,0.235,0.214,0.194,0.176,0.160,0.146,0.132
13,1.300,1.182,1.083,1.000,0.867,0.813,0.722,0.650,0.591,0.542,0.481,0.433,0.394,0.361,0.333,0.302,0.277,0.255,0.232,0.210,0.191,0.173,0.159,0.143
15,1.500,1.364,1.250,1.154,1.000,0.938,0.833,0.750,0.682,0.625,0.556,0.500,0.455,0.417,0.385,0.349,0.319,0.294,0.268,0.242,0.221,0.200,0.183,0.165
16,1.600,1.455,1.333,1.231,1.067,1.000,0.889,0.800,0.727,0.667,0.593,0.533,0.485,0.444,0.410,0.372,0.340,0.314,0.286,0.258,0.235,0.213,0.195,0.176
18,1.800,1.636,1.500,1.385,1.200,1.125,1.000,0.900,0.818,0.750,0.667,
@jjthrash
jjthrash / 0_reuse_code.js
Created March 21, 2017 17:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am jjthrash on github.
  • I am jimmythrasher (https://keybase.io/jimmythrasher) on keybase.
  • I have a public key ASAU-eVLmexs2em_p-9CgsbaPAd7QTuR6zRGjchjcaaZ0Ao

To claim this, I am signing this object:

@jjthrash
jjthrash / git-recent-branch.sh
Last active January 13, 2016 18:16
Put this in your path as `git-recent-branch` and you can do `git recent-branch` and `git recent-branch -r`
#!/bin/bash
branches=`git branch $* | perl -pe 's/^..(.*?)( ->.*)?$/\1/'`
for k in $branches; do
echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- |
head -n 1`\\t$k
done | sort -r
@jjthrash
jjthrash / thing.js
Created January 5, 2016 19:31
User script to hide Facebook Trending stuff
// ==UserScript==
// @name Remove FB Trending
// @namespace com.jimmythrasher.removetrending
// @include https://www.facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
function doItDude() {
var it = document.getElementById("pagelet_trending_tags_and_topics");
@jjthrash
jjthrash / -
Created December 2, 2014 16:17
diannao:kakoune (11:16) $ lldb kak
(lldb) target create "kak"
Current executable set to 'kak' (x86_64).
(lldb) run
Process 58924 launched: '/usr/local/bin/kak' (x86_64)
Process 58924 stopped
* thread #1: tid = 0x468020, 0x00007fff8b16094a libsystem_kernel.dylib`poll + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff8b16094a libsystem_kernel.dylib`poll + 10
libsystem_kernel.dylib`poll + 10:
-> 0x7fff8b16094a: jae 0x7fff8b160954 ; poll + 20
(page "index.html")
(def multipliers [1 2 4 7 10 15])
(def default-counts [0 0 0 0 0 0])
(defc counts default-counts)
(defc= score (reduce + (map * counts multipliers)))
(defn increment-counter [idx c]
(assoc c idx (inc (get c idx))))
@jjthrash
jjthrash / -
Created November 13, 2013 15:15
+- (void)downloadDocumentAtURL:(NSURL*)url {
+ @autoreleasepool {
+ NSData *data = [NSData dataWithContentsOfURL:url];
+ NSString *filename = [[[NSUUID UUID] UUIDString] stringByAppendingPathExtension:@"pdf"];
+ NSString *fullPath = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];
+
+ [data writeToFile:fullPath atomically:NO];
+
+ ReaderDocument *document = [ReaderDocument withDocumentFilePath:fullPath password:nil];
+ [self performSelectorOnMainThread:@selector(displayDocument:) withObject:document waitUntilDon