Skip to content

Instantly share code, notes, and snippets.

View johnnyji's full-sized avatar
🏠
Working from home

Johnny Ji johnnyji

🏠
Working from home
View GitHub Profile
@johnnyji
johnnyji / .vimrc
Created March 21, 2016 16:24
My .vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable Pathogen
execute pathogen#infect()
syntax on
" Enable filetype plugins
filetype plugin on
filetype indent on
@johnnyji
johnnyji / codemod-add-semicolon.js
Last active April 14, 2018 16:48
Codemod for Babel 6 Semicolon Requirement
module.exports = function (file, api) {
var j = api.jscodeshift;
var root = j(file.source);
// Finds the all classes that have properties
root
.find(j.ClassDeclaration, {
body: {
type: 'ClassBody',
body: [{
@johnnyji
johnnyji / partytime.js
Created July 25, 2015 21:56
It's Party Time
var sys = require("sys");
var exec = require('child_process').exec;
var five = require('johnny-five');
var board = new five.Board();
function puts(err, stdout, stderr) { sys.puts(stdout) };
board.on('ready', function() {
console.log("board ready");
var button = new five.Button(5);
@johnnyji
johnnyji / JavaScript
Created July 25, 2015 21:55
It's Party Time
var sys = require("sys");
var exec = require('child_process').exec;
var five = require('johnny-five');
var board = new five.Board();
function puts(err, stdout, stderr) { sys.puts(stdout) };
board.on('ready', function() {
console.log("board ready");
var button = new five.Button(5);
@johnnyji
johnnyji / gist:d1226c9467a51f7d8b39
Created June 16, 2015 21:46
Rubocop pre-commit hook
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1
@johnnyji
johnnyji / candidates.rb
Last active August 29, 2015 14:18
candidates exercise
require 'active_support/all'
@candidates = [
{
id: 5,
years_of_experience: 4,
github_points: 293,
languages: ['C', 'Ruby', 'Python', 'Clojure'],
date_applied: 5.days.ago.to_date,
age: 26