Skip to content

Instantly share code, notes, and snippets.

View cjohnson496's full-sized avatar

Charles Johnson cjohnson496

View GitHub Profile
@cjohnson496
cjohnson496 / creating-project-pages-using-git-subtree.md
Created November 13, 2016 20:43 — forked from waylan/creating-project-pages-using-git-subtree.md
Use subtree to merge commits from a project subdir (i.e., 'docs/') to gh-pages branch.

Creatings Project Pages using git-subtree

Many projects maintain their documentation within a subfolder of their repository (for example docs/). That way, as new features are added or existing features are modified, the documentation can be updated in the same commit. The git-subtree command can be an effective tool to merge those changes from the documentation subdirectory of your project to the root of the gh-pages branch.

Setup

According to the author of git-subtree, the command is included with git 1.7.11 and higher. However, it's in the "contrib" subtree for now, so it's not installed by default. Search for "git-subtree" in your system's package manager and install the package if it exists. If not, or if you are using an older version of git, the easiest way is to install git-subtree from the author's repo.

$ git clone https://github.com/apenwarr/git-subtree.git
@cjohnson496
cjohnson496 / README.md
Created December 8, 2016 19:39 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
#!/bin/bash
#
# https://gist.github.com/oodavid/40fa04325f2b762dfb9e
#
# 1 - Copy this file to your home directory
# 2 - Add the following line to ~/.bash_logout
# /bin/bash ~/seeyouspacecowboy.sh; sleep 1
# 3 - Add the following to ~/bashrc
# trap_exit() {
# . "$HOME/.bash_logout"

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. T

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install OS X

  • Make backup
  • Download Sierra installer
  • Format USB Stick, name it Sierra
@cjohnson496
cjohnson496 / osx-setup.sh
Created December 19, 2016 23:10 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
@cjohnson496
cjohnson496 / gist:2b73173945cadf0630434fdf507ac332
Created December 28, 2016 19:56 — forked from rroemhild/gist:190970
simple shell script log function
# Vars for log()
LOGGER="/usr/bin/logger" # Path to logger
FACILITY="LOCAL4" # Syslog facility
PROG="´basename $0´" # Program name
SYSLOG="YES" # Write to Syslog? (YES/NO)
VERBOSE="NO" # Write to STDOUT? (YES/NO)
# Function: log()
# Usage: log priority "message"
log()
@cjohnson496
cjohnson496 / 0_reuse_code.js
Created January 10, 2017 08:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cjohnson496
cjohnson496 / .git-commit-template.txt
Created January 12, 2017 23:02 — forked from adeekshith/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
rsync -avzPE --numeric-ids --exclude='/tmp' --exclude='/tmpgen' --exclude='/proc' --exclude='/sys' --exclude='/media' --exclude='/mnt' --exclude='/lost+found' --exclude='/selinux'
@cjohnson496
cjohnson496 / lsmod.examples
Created April 25, 2017 21:32
Different ways of listing kernel modules.
lsmod | cut -d' ' -f1 |sort |sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'
lsmod | cut -d' ' -f1 | xargs modinfo | egrep '^file|^desc|^dep' | sed -e'/^dep/s/$/\n/g'