Skip to content

Instantly share code, notes, and snippets.

View cflynn07's full-sized avatar

Casey Flynn cflynn07

View GitHub Profile
@cflynn07
cflynn07 / server.coffee
Last active December 15, 2015 16:59
Configuring main file in express.io app to share routes between socket.io and HTTP requests for an API that's accessible via websockets and HTTP
View server.coffee
fs = require 'fs'
express = require 'express.io'
path = require 'path'
#If we didn't get to server.js from bootstrap.js
if !GLOBAL.asset_hash?
GLOBAL.asset_hash = 'main'
#Read dotCloud ENV file if exists
try
@cflynn07
cflynn07 / setup.sh
Last active December 24, 2015 16:29
View setup.sh
#!/bin/sh
line="-------------------------------------------------"
bigline="====================================================="
squigline="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
slashline="/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/"
msg=""
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
red="\033[0;31m"
@cflynn07
cflynn07 / DOSetup
Last active December 25, 2015 16:29
View DOSetup
#!/usr/bin/env bash
apt-get install git -y
apt-get install curl -y
# install RVM
curl -o rvm.sh -L https://get.rvm.io
chmod +x rvm.sh
./rvm.sh stable
source /etc/profile.d/rvm.sh
View gist:07eecec890dfbc939a67
echo 'kern.maxfiles=20480' | sudo tee -a /etc/sysctl.conf
echo -e 'limit maxfiles 8192 20480\nlimit maxproc 1000 2000' | sudo tee -a /etc/launchd.conf
echo 'ulimit -n 4096' | sudo tee -a /etc/profile
sudo shutdown -r now
View gist:5201cec81ec36b9d9696
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
cosdnfig nudgePercentOf screenSize
config resizePercentOf screenSize
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
View gist:8b0ba1eb99a1d92b3c45615f72c80205
<?xml version="1.0"?>
<root>
<item>
<name>CTRL+CMD+H to CTRL+CMD+LEFT_ARROW</name>
<identifier>private.ctrl_cmd_h_to_ctrl_cmd_left_arrow</identifier>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::OPTION_L,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L
@cflynn07
cflynn07 / .vimrc
Last active January 22, 2019 21:36
View .vimrc
" Casey Flynn <cflynn.us@gmail.com>
" Dec 12, 2018
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'ctrlpvim/ctrlp.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'fatih/vim-go'
Plug 'godlygeek/tabular'
@cflynn07
cflynn07 / .zshrc
Last active February 18, 2019 02:46
zshrc backup
View .zshrc
# Casey Flynn <cflynn.us@gmail.com>
# January 18, 2019
source /Users/caseyflynn/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
View handlers.go
package handlers
import (
"html/template"
"io/ioutil"
"log"
"net/http"
)
// HomeHandler / route handler
View High Performance MySQL Notes
# Chapter 1
###### p1
- Reason for storage engine architecture is to separate query processing and data
storage & retrieval
###### p4
- two lock types: shared locks, exclusive locks (read locks, write locks) - lock granularity is customizable in MySQL
- table locks - lowest overhead
- READ LOCAL - table lock, allows some types of concurrent write ops