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
call plug#begin('~/.vim/plugged') | |
" auto complete | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} # auto-complete | |
" fuzzy file opener | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
" horizontal alignment | |
Plug 'junegunn/vim-easy-align' | |
" syntax highlighting for everything | |
Plug 'sheerun/vim-polyglot' |
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
%AnonEnv1 = type { | |
i32, | |
i32 | |
} | |
%AnonFn1 = type { | |
i32*, | |
i32* | |
} |
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
class Node | |
end | |
class FooNode < Node | |
end | |
class BarNode < Node | |
end | |
class Parser |
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
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-sensible' | |
Plug 'tpope/vim-commentary' | |
Plug 'tpope/vim-rsi' | |
Plug 'tpope/vim-repeat' | |
Plug 'tpope/vim-repeat' | |
Plug 'tpope/vim-sleuth' | |
Plug 'ludovicchabant/vim-gutentags' |
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
inoremap <expr> <tab> pumvisible() ? '<c-n>' : '<tab>' | |
inoremap <expr> <s-tab> pumvisible() ? '<c-p>' : '<tab>' | |
augroup autocomplete | |
autocmd! | |
autocmd TextChangedI * call TypeComplete() | |
augroup end | |
fun! TypeComplete() | |
if getline('.')[col('.') - 2] =~ '\K' && getline('.')[col('.') - 1] !~ '\K' | |
call feedkeys("\<c-n>") | |
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
function get (obj, key, fallback=undefined) { | |
const keyPath = key.split('.') | |
try { | |
return keyPath.reduce((obj, key) => { | |
if (!(key in obj)) throw new TypeError() | |
return obj[key] | |
}, obj) | |
} catch (e) { | |
return fallback | |
} |
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
<input type="file"> | |
<script> | |
var el = document.querySelector('input[type="file"]'); | |
el.addEventListener('change', function(event) { | |
let files = e.target.files; | |
for (let i = 0; i < files.length; i++) { | |
let file = files[i]; | |
var xhr = new XMLHttpRequest(); | |
// set the url to wherever you meteor app is running |
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
<input type="file"> | |
<script> | |
var el = document.querySelector('input[type="file"]'); | |
el.addEventListener('change', function(event) { | |
let files = e.target.files; | |
for (let i = 0; i < files.length; i++) { | |
let file = files[i]; | |
var xhr = new XMLHttpRequest(); |
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
import { Meteor } from 'meteor/meteor'; | |
WebApp.connectHandlers.use('/file', (req, res) => { | |
res.setHeader("Access-Control-Allow-Methods", "PUT"); | |
res.setHeader("Access-Control-Allow-Origin", "*"); | |
res.setHeader("Access-Control-Allow-Headers", "Content-Type"); | |
if (req.method === 'OPTIONS') { | |
res.writeHead(200); | |
res.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
import { Meteor } from 'meteor/meteor'; | |
WebApp.connectHandlers.use('/file', (req, res) => { | |
// We only care about PUT methods | |
res.setHeader("Access-Control-Allow-Methods", "PUT"); | |
// I am running meteor as a backend, see https://iamlawrence.me/agnostic-meteor | |
// Therefore we need to enable CORS | |
res.setHeader("Access-Control-Allow-Origin", "*"); | |
res.setHeader("Access-Control-Allow-Headers", "Content-Type"); |
NewerOlder