I hereby claim:
- I am jcouyang on github.
- I am oyanglulu (https://keybase.io/oyanglulu) on keybase.
- I have a public key ASDd7C_jnHrfyZ-hv7yEPxWFSwbOCfYOX_oqoujJ55JeXwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<keymap version="1" name="Emacs copy" parent="macOS For All"> | |
<action id="$Copy"> | |
<keyboard-shortcut first-keystroke="alt c" /> | |
</action> | |
<action id="$Cut"> | |
<keyboard-shortcut first-keystroke="shift delete" /> | |
</action> | |
<action id="$Delete"> | |
<keyboard-shortcut first-keystroke="delete" /> | |
<keyboard-shortcut first-keystroke="ctrl d" /> |
require "httparty" | |
require 'json' | |
url = "https://hypothes.is/api/search?wildcard_uri=https://blog.oyanglul.us/*&sort=created" | |
HEADER = <<-EOXML | |
<?xml version="1.0"?> | |
<rss version="2.0" | |
xmlns:atom="http://www.w3.org/2005/Atom" | |
xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
<channel> |
settings.startToShowEmoji = 3; | |
settings.tabsMRUOrder = false; | |
settings.tabsThreshold = 4; | |
api.mapkey(';oc', 'Org Capture', function() { | |
location.href='org-protocol://capture?' + | |
new URLSearchParams({ | |
template: 'x', | |
url: window.location.href, | |
title: document.title, |
// Higher Kind Type dictionary | |
interface _<A> { } | |
type HKT = keyof _<any> | |
type $<F extends HKT, A> = _<A>[F] | |
// Functor Type Class | |
interface Functor<F extends HKT> { | |
map<A, B>(f: (a: A) => B, fa: $<F, A>): $<F, B> |
height = params['height'].to_f | |
weight = params['weight'].to_f | |
bmi = weight * 10000.0 / (height * height) | |
health = if(bmi < 18.5) | |
'underweight' | |
elsif (bmi < 24.9) | |
'normal' | |
elsif (bmi < 30) | |
'Overweight' | |
elsif (bmi >= 30) |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: syncthing | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Multi-user daemonized version of syncthing. |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: ipfs daemon | |
# Required-Start: $local_fs $remote_fs $network $syslog $named | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts the ipfs daemon | |
# Description: Starts the ipfs daemon using the start-stop-daemon | |
### END INIT INFO |
in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)
which would probably blow you browser memory by trying to send all requests at the same time
solution is limit the concurrent of requests, and wrap promise in thunk
Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])
import Control.Monad | |
import Data.List | |
solution n = | |
undefined | |
readInt :: IO Int | |
readInt = readLn | |
getInputs :: Int -> IO [Int] | |
getInputs lines = replicateM lines readInt |