This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" NeoBundle | |
" | |
if has('vim_starting') | |
set runtimepath+=~/.nvim/bundle/neobundle.vim/ | |
endif | |
call neobundle#begin(expand('~/.nvim/bundle')) | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
" Completion | |
NeoBundle 'Shougo/deoplete.nvim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <silent> <leader>gm :tab split<CR>:Glistmod<CR> | |
nnoremap <silent> <c-s-j> :call g:DiffNextLoc()<CR> | |
nnoremap <silent> <c-s-k> :call g:DiffPrevLoc()<CR> | |
command! Glistmod only | call g:ListModified() | Gdiff | |
function! g:ListModified() | |
let old_makeprg=&makeprg | |
let old_errorformat=&errorformat | |
let &makeprg = "git ls-files -m" | |
let &errorformat="%f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns async-test.throttle.core | |
(:require [cljs.core.async :refer [chan close!o sliding-buffer]] | |
[clojure.string :as string]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go alts!]])) | |
(def c (chan (sliding-buffer 1))) | |
(def loc-div (.getElementById js/document "location")) | |
(.addEventListener js/window "mousemove" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mholt [9:10 AM] | |
When using http.Get(), is it really necessary to read the full response body just to close it later? | |
[9:10] | |
The docs keep saying `Caller should close resp.Body when done reading from it.` and I keep seeing code like this: | |
``` | |
io.Copy(ioutil.Discard, resp.Body) | |
resp.Body.Close() | |
``` |
What is sync.Pool in golang and How to use it
sync.Pool (1/2)
Many Go libraries include custom thread-safe free lists, like this:
var objPool = make(chan *Object, 10)
func obj() *Object {
select {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This demonstrates that, when using async/await, a crash in the task will crash the caller | |
defmodule Tasker do | |
def good(message) do | |
IO.puts message | |
end | |
def bad(message) do | |
IO.puts message | |
raise "I'm BAD!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#File: tree2githubmd | |
#Description: Convert output of unix tree utility to Github flavoured Markdown | |
tree=$(tree -f --noreport --charset ascii $1 | | |
sed -e 's/| \+/ /g' -e 's/[|`]-\+/ */g' -e 's:\(* \)\(\(.*/\)\([^/]\+\)\):\1[\4](\2):g') | |
printf "# Code/Directory Structure:\n\n${tree}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
head 'https://vim.googlecode.com/hg/' | |
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
version '7.3.682' | |
def features; %w(tiny small normal big huge) end |
OlderNewer