Skip to content

Instantly share code, notes, and snippets.

View loganking's full-sized avatar

Logan King loganking

View GitHub Profile
@loganking
loganking / gist:4be8161ea628fba57437f490c22e2b39
Last active May 22, 2016 21:04
AJAX wrapper for XMLHttpRequest supporting GET and POST
/*
data (optional) - a JSON string to send with the request
*/
function ajax(method, url, handler, data) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.readyState === 4) {
if (this.status === 200) {
handler(null, JSON.parse(this.responseText));
@loganking
loganking / .vimrc
Created August 13, 2015 21:08
My current .vimrc
" First load Pathogen
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
""
"" Basic Setup
""
set nocompatible " Use vim, no vi defaults