Skip to content

Instantly share code, notes, and snippets.

View obihann's full-sized avatar

Jeffrey Hann obihann

View GitHub Profile
@obihann
obihann / .eslintrc
Created June 21, 2016 16:30
ESLint config for react and jsx
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"settings": {
"ecmascript": 6,
"jsx": true
},
@obihann
obihann / gulpfile.js
Created June 21, 2016 16:29
Gulp script for webkit and browsersync that includes tar/gzip and rsync for bundling and releaseing.
var gulp = require('gulp');
var tar = require('gulp-tar');
var gzip = require('gulp-gzip');
var webpack = require('webpack-stream');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var browserSync = require('browser-sync').create();
var rsync = require('gulp-rsync');
var entry, dest, webkitDevConfig, webkitConfig, devServer;
@obihann
obihann / webpack-dev.config.js
Created June 21, 2016 16:27
Development ready webpack config for images, es2015/babel/react js/jsx, and sass/scss with watch and source maps
var autoprefixer = require('autoprefixer');
const webpack = require('webpack');
module.exports = {
watch: true,
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
module: {
@obihann
obihann / webpack.config.js
Created June 21, 2016 16:27
Production ready webpack config for images, es2015/babel/react js/jsx, and sass/scss
var autoprefixer = require('autoprefixer');
const webpack = require('webpack');
module.exports = {
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
module: {
loaders: [
@obihann
obihann / gitafterdark.py
Last active May 21, 2017 00:19
Lets see how much work we do after closing time
import subprocess
import re
from dateutil import parser
class History(object):
def __init__(self, commits):
self._commits = ['%s' % n for n in commits if n.ot]
def __iter__(self):
return iter()
@obihann
obihann / barebones gmail notifier
Created May 30, 2016 18:30 — forked from danchoi/barebones gmail notifier
A lightweight command-line Gmail notifier. Fill in your gmail username and password and run the script from the command line. It polls your gmail account and shows the latest messages in a terminal window.
require 'rubygems'
require 'net/imap'
require 'tmail'
require 'parsedate'
# NOTE: Set these values before you run the script
# Your gmail username
USERNAME = "YOUR_USERNAME"
# Your gmail password
#s.privileged = false
#s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
bash -c 'BASH_ENV=/etc/profile exec bash'
#!/bin/bash
apt-get install --yes lsb-release
DISTRIB_CODENAME=$(lsb_release --codename --short)
DEB="puppetlabs-release-${DISTRIB_CODENAME}.deb"
DEB_PROVIDES="/etc/apt/sources.list.d/puppetlabs.list" # Assume that this file's existence means we have the Puppet Labs repo added
if [ ! -e $DEB_PROVIDES ]
then
# Print statement useful for debugging, but automated runs of this will interpret any output as an error
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@obihann
obihann / main.hs
Last active September 25, 2015 12:21
Multiples of 3 and 5
-- If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
-- Find the sum of all the multiples of 3 or 5 below 1000.
rec_sum [] = 0
rec_sum (x:xs) = x + rec_sum xs
nums = [(x::Integer) | x <- [1..999], x `mod` 3 == 0 || x `mod` 5 == 0]
total = rec_sum nums
main = do