Skip to content

Instantly share code, notes, and snippets.

@Billy-
Billy- / webpack-unused-files.sh
Created January 22, 2019 14:39 — forked from xjamundx/webpack-unused-files.sh
Quickly identify files unused by webpack
# ----------------------------------- #
webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt;
cd src; # assumes all your files are here
find . -name *.js?(x) | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files
cd ..;
cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'";
rm files-processed.txt files-all.txt;
# ----------------------------------- #
@Billy-
Billy- / rename-author.sh
Created October 10, 2018 19:35
Rewrite commit authors
# "borrowed" from https://stackoverflow.com/a/23564785/1879895
git filter-branch --commit-filter \
'if [ "$GIT_AUTHOR_NAME" = "OldAuthor Name" ]; then \
export GIT_AUTHOR_NAME="Author Name";\
export [email protected];\
export GIT_COMMITTER_NAME="Commmiter Name";\
export [email protected];\
fi;\
git commit-tree "$@"'
@Billy-
Billy- / tmux_build_from_source_CentOS.sh
Created January 20, 2018 21:47 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@Billy-
Billy- / README.md
Last active April 15, 2019 16:48
deep version of lodash omit

Inspired by this issue on the lodash repo, asking for deep functionality for omit.

Note that there are plans to remove omit entirely in lodash v5... and props to this comment (and the one it quotes) in response to that 😆.

@Billy-
Billy- / project-compose.sh
Created July 3, 2017 21:53
project-compose, to compose your docker-compose files across projects. I heard you liked composing files.
#!/bin/bash
dev=''
build=''
restart=''
help=''
getopt --test > /dev/null
if [[ $? -ne 4 ]]; then
echo "I’m sorry, `getopt --test` failed in this environment."
@Billy-
Billy- / server.js
Last active October 23, 2016 17:50
Node static server handler
const http = require('http'),
staticServerHandler = require('./staticServerHandler'),
port = 8080
let server = http.createServer(staticServerHandler)
server.listen(port)
console.log('Static server listening on port ' + port)
@Billy-
Billy- / export_repo_issues_to_csv.py
Last active November 9, 2021 12:05 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
Derived from https://gist.github.com/unbracketed/3380407
"""
import csv
import requests
FROM centos:7
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
&& source /root/.nvm/nvm.sh \
&& nvm install 5.0
@Billy-
Billy- / code_style_guidelines.md
Last active August 29, 2015 14:27
Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

Code Style Guidelines

Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

General guidelines

  • Don't save out files with trailing whitespace
  • Put a newline at the end of the file
  • Use Unix style (LF) line endings
@Billy-
Billy- / handlebars.js
Last active August 29, 2015 14:27
Gulp task for compiling handlebars templates
var gulp = require('gulp');
gulp.task('handlebars', ['font:icon'], function () {
var config = require('../config');
var handlebars = require('gulp-compile-handlebars');
var bs = require('browser-sync').get('gulp');
var ext = require('gulp-ext');
var plumber = require('gulp-plumber');
var path = require('path');
var fs = require('fs');