Skip to content

Instantly share code, notes, and snippets.

View jimbol's full-sized avatar
🕵️‍♂️
Working on a secret project

Jim Hall jimbol

🕵️‍♂️
Working on a secret project
View GitHub Profile
@jimbol
jimbol / use_cache.py
Created October 29, 2020 17:50
use_cache.py
def get_bucket():
return 'your bucket key'
def get_key():
return 'get cache key'
def use_cache(f):
@wraps(f)
def decorated_function(*args, **kwargs):
client = boto3.client('s3')
@jimbol
jimbol / estimate-levels.md
Last active September 24, 2019 20:45
Estimate Levels

Estimate levels

  • 1h
  • 4h
  • 1d
  • 3d
  • 1w
@jimbol
jimbol / scraper.js
Created June 7, 2018 02:45
Scraper concept
Searcher({
baseUrl: String,
queries: Array<String>,
executeQuery: Function(Driver): Driver,
pages: 3,
goToNextPage: Function(Driver): NextPageDriver
scraper: Scraper,
})
Scraper({
@jimbol
jimbol / autocomplete-makefile.md
Created November 7, 2017 15:45
How to add Makefile autocomplete

To allow make file auto completion just add the snippet here to your bash profile or .zshrc https://stackoverflow.com/a/38415982/965352

If you use zshell, you might have to add this before the the snippet.

autoload -U bashcompinit
bashcompinit
@jimbol
jimbol / pass-comp-as-prop.js
Created October 5, 2017 15:26
Passing a component as a prop
import { UserComp, OtherPersonComp } from './components';
const PersonComp = ({ InnerComp, person }) => {
return <section>
<InnerComp person={person}>
</section>;
}
const mapState = (state) => ({
InnerComp: state.person.isUser ? UserComp : OtherPersonComp,
i = 0
def multiply(a, b):
i = i + 1
print(i)
return a * b
def memoize_multiply(a, b):
# do stuff here
return multiply(a, b)
@jimbol
jimbol / managed-flow-vs-branched-flow.md
Last active July 14, 2017 14:24
Managed Flow vs. Branched Flow with Redux Saga

Managed Flow vs. Branched Flow with Redux Saga

Rather than dispatching actions to get us to the next step of an effect, we should manage the async flow in a single effect whenever possible.

Chaining effects and sagas in this manner leads to unexpected side effects.

GOOD

Managed Flow

Function called
@jimbol
jimbol / bills-data-structure.json
Created April 30, 2017 20:56
Data structures for MI bills
/* Bills */
{
"2017-SB-0149": {
"id": "2017-SB-0149",
"sponsors": ["goeff-hansen"],
"categories": [
{
"name": "Appropriations: zero budget",
"url": "yadda yadda"
},{
@jimbol
jimbol / word-predictor.js
Created April 17, 2017 13:47
Word predictor
// Sentence predictor
// Given some data
let data = 'A Stop on the Salt Route 1000 B.C. As they rounded a bend in the path that ran beside the river, Lara recognized the silhouette of a fig tree atop a nearby hill. The weather was hot and the days were long. The fig tree was in full leaf, but not yet bearing fruit. Soon Lara spotted other landmarks—an outcropping of limestone beside the path that had a silhouette like a mans face, a marshy spot beside the river where the waterfowl were easily startled, a tall tree that looked like a man with his arms upraised. They were drawing near to the place where there was an island in the river. The island was a good spot to make camp. They would sleep on the island tonight. Lara had been back and forth along the river path many times in her short life. Her people had not created the path—it had always been there, like the river—but their deerskin-shod feet and the wooden wheels of their handcarts kept the path well worn. Laras people were salt traders, and their livel
@jimbol
jimbol / bill-summarization-journal.md
Last active April 15, 2017 18:12
Bill summarization journal

Bill summarization with gensim

Goals

Following this tutorial

  • Take whole bills
  • Summarize into layman readable content
  • Summarize changes

Domain - Michigan Laws

Terms: