Skip to content

Instantly share code, notes, and snippets.

View jleedev's full-sized avatar
🧙‍♀️

Josh Lee jleedev

🧙‍♀️
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!doctype html>
<meta charset=utf-8>
<script type=🧩 id=lodash>
import content from "lodash/content";
const p = document.createElement("p");
p.textContent = content;
export default () => p.cloneNode(true);
</script>
import os
import sys
arg = sys.argv[1]
start = os.getcwd()
os.mkdir('tmp')
os.chdir('tmp')
@jleedev
jleedev / .gvimrc
Last active January 23, 2019 13:33
dark mode
function! SetMode()
call system("defaults read -g AppleInterfaceStyle")
if v:shell_error
se bg=light
else
se bg=dark
endif
endfunction
call SetMode()
@jleedev
jleedev / fib.rb
Created December 10, 2009 01:12
Fibonacci numbers in ruby
require 'matrix'
# fib1: Fast algorithm using the Golden Ratio
$sqrt5 = Math.sqrt 5
$phi = (1 + $sqrt5) / 2
def fib1 n
(($phi**n - (1-$phi)**n) / $sqrt5).to_int
end
@jleedev
jleedev / pa.sh
Created September 1, 2018 14:05
#!/bin/bash
# vi: ts=2 sw=2 et
set -eu
type node || source "$NVM_DIR/nvm.sh"
type pip || source ./venv/bin/activate
type curl osmtogeojson tippecanoe aws
set -x
query='[out:json];
@jleedev
jleedev / delete.stupid.apple.garbage.plist
Created March 30, 2018 01:16
Library/LaunchDaemons/delete.stupid.apple.garbage.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>delete.stupid.apple.garbage</string>
<key>Program</key>
<string>/bin/sh</string>
<key>ProgramArguments</key>
<array>
@jleedev
jleedev / .nvmrc
Last active February 7, 2018 20:16
event driven vs promise driven
v9.5.0
HTTP/1.0 200 OK
Server: alphapd
Date: Sun Feb 12 16:21:12 2017
Pragma: no-cache
Cache-Control: no-cache
Content-type: text/html
@jleedev
jleedev / Main.java
Last active February 11, 2017 15:17
java producer consumer
package com.example;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
public class Main {
static void run(int inputSize, int batchSize) throws Exception {
ExecutorService executor = Executors.newCachedThreadPool();
BlockingQueue<Integer> q = new LinkedBlockingQueue<>(2 * batchSize);