Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
KNEE DEEP IN THE HOOPLA

Josh Holbrook jfhbrook

💭
KNEE DEEP IN THE HOOPLA
View GitHub Profile
View derf.log
(base) PS C:\Users\Josh\source\repos\jfhbrook\ihydra> npm run dev
> ihydra@5.2.0 dev C:\Users\Josh\source\repos\jfhbrook\ihydra
> electron-webpack dev
┏ Main -----------------------
Hash: 6030450ce2ca34ce9323
Version: webpack 4.41.5
Time: 497ms
View .vimrc
"vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
call vundle#end()
filetype plugin indent on
@jfhbrook
jfhbrook / .bash_profile
Last active Feb 6, 2020
My current osx bash profile
View .bash_profile
alias ls='ls -G'
# \h:\W \u\$
PS1='[\u@\h \W]\$ '
# homebrew stuff
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
# homedir bins
export PATH="${HOME}/bin:${PATH}"
View welp.log
Traceback (most recent call last):
File "C:\Users\Josh\Anaconda3\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "C:\Users\Josh\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Josh\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\Josh\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\Josh\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
@jfhbrook
jfhbrook / pageTitle.js
Created Jan 21, 2020
A bookmarklet for showing the title of the page on the top-left corner
View pageTitle.js
javascript:(function () { var title = document.createElement("div"); title.style.zIndex = 9001; title.style.position = "absolute"; title.style.left = "0px"; title.style.top = "0px"; title.style.background = "#fff"; title.innerHTML = '<h1>'+document.title+'</h1>'; document.getElementsByTagName("body")[0].appendChild(title); setTimeout(function () { title.style.display = "none"; }, 5000); })()
View analogous_python.py
from types import MethodType
def create_animal(_sound):
animal = type('Animal', (object,), dict())
animal._sound = _sound
def sound(self):
print(self._sound)
@jfhbrook
jfhbrook / haxxx.ts
Last active Nov 25, 2019
I *think* this syntax can be rewritten using a typescript compiler transformer <_<;;;
View haxxx.ts
const output = with (
const x = await xP, // "unpacks" anything that "exposes a monadic interface" (depends on your library)
y = await yP
) { yield [x, y]; } //
View wrap.js
function wrap(dumbThing) {
const handler = {};
function callback(tab) { return handler.handle(tab); };
try {
let p = dumbThing(callback);
} catch (err) {
return Promise.reject(err);
}
View problem.ts
import { promisify } from "util";
import mkdirp, { Made } from "mkdirp";
type Pony = "pony";
function eventualPony(cb: (err: Error | null, result: Pony) => void) {
setTimeout(() => cb(null, "pony"), 1000);
};
View builder.ts
import fs from "fs";
import { task, Task } from "fp-ts/lib/Task";
import mkdirp from "mkdirp";
import fetch from "node-fetch";
import { IPath, join, pathToStr } from "./path";
export interface IBuilderConfig {
artifactsDirectory: IPath;
You can’t perform that action at this time.