Skip to content

Instantly share code, notes, and snippets.

View jasongonzales23's full-sized avatar

Jason jasongonzales23

  • DevZero
  • San Francisco, CA
View GitHub Profile
" Make Vim more useful
set nocompatible
filetype off " required
set ttyfast
set lazyredraw
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" Make Vim more useful
set nocompatible
filetype off " required
set ttyfast
set lazyredraw
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
export function parseParams(params) {
if (!params) {
return undefined
}
if (params['~id']) {
// it's a branch link, already parsed
return params
}
// parse whilapp:// link
const urlString = params['+non_branch_link'] || params['~referring_link']
@jasongonzales23
jasongonzales23 / .vimrc
Created October 8, 2017 21:49
Vim console.log shortcut
" Console log from insert mode; Puts focus inside parentheses
imap cll console.log()<Esc><S-f>(a
" Console log from visual mode on next line, puts visual selection inside parentheses
vmap cll yocll<Esc>p
" Console log from normal mode, inserted on next line with word your on inside parentheses
nmap cll yiwocll<Esc>p
@jasongonzales23
jasongonzales23 / serverless_example.yml
Last active September 24, 2017 19:45
trying to get multiple dynamodb tables going
service: serverless-expense-tracker
frameworkVersion: ">=1.1.0 <2.0.0"
provider:
name: aws
runtime: nodejs6.10
environment:
EXPENSES_TABLE: "${self:service}-${opt:stage, self:provider.stage}-expenses"
BUDGETS_TABLE: "${self:service}-${opt:stage, self:provider.stage}-budgets"
@jasongonzales23
jasongonzales23 / expenseTrackerDataModel.js
Last active September 10, 2017 16:25
expense tracker data model
users: {
id: "UUID",
email: "string",
firstName: "string",
lastName: "string",
group: groupId
}
groups: {
id: "UUID",
// KPW
import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import config from '../config'
import _debug from 'debug'
import newrelic_staging from './newrelic_staging'
import newrelic_prod from './newrelic_prod'
const debug = _debug('app:webpack:config')
@jasongonzales23
jasongonzales23 / karma.conf.js
Created August 4, 2017 19:04
webpack karma config
// this one was in KPW
import { argv } from 'yargs'
import config from '../config'
import webpackConfig from './webpack.config'
import _debug from 'debug'
const debug = _debug('app:karma')
debug('Create configuration.')
module.exports = function(cfg) {
@jasongonzales23
jasongonzales23 / index.html
Created June 25, 2017 18:34
JS Bin [log sort algo] // source https://jsbin.com/devepog
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[log sort algo]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@jasongonzales23
jasongonzales23 / let_d3_render.jsx
Last active June 11, 2017 20:05
Bad example of integrating ReactJS + d3.js
// inside yr React component
componentDidMount: function() {
var el = this.getDOMNode();
D3Chart.create(el, props);
},
componentDidUpdate: function(prevProps, prevState) {
var el = this.getDOMNode();
D3Chart.update(el, props);
},