Skip to content

Instantly share code, notes, and snippets.

View bhardin's full-sized avatar
🍖
In meatspace

Brett Hardin bhardin

🍖
In meatspace
View GitHub Profile
@oaksakal
oaksakal / readme.rst
Created August 13, 2011 08:28 — forked from stefanfoulis/readme.rst
example supervisord script for starting django and gunicorn

example configuration for supervisord

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 13, 2024 05:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@stingh711
stingh711 / mount_ebs.sh
Created July 24, 2012 08:02
How to mount another EBS as /var on EC2 (ubuntu)
#!/bin/bash
#attach the EBS to /dev/sdf before running it
#format EBS
mkfs -t ext4 /dev/xvdf
#copy original /var to /dev/xvdf
mkdir /mnt/new
mount /dev/xvdf /mnt/new
cd /var
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@alex-zige
alex-zige / gist:5795358
Last active June 8, 2023 07:49
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views
@avdgaag
avdgaag / gist:6865420
Last active December 24, 2015 21:29
Run Rubocop using the project settings on modified files in your Git repository. Store this in `.git/hooks/pre-commit` to reject commits with style offsenses.
#!/bin/bash
git diff --cached --name-status --diff-filter=ACM | awk '/\.rb$/ { print $2 }' | xargs rubocop -f s
exit_code=$?
if [[ $exit_code != 0 ]] ; then
echo 'Your commit was rejected because Rubocop found style guide violations.'
echo 'Run `rake rubocop` to test your code and inspect the offenses Rubocop'
echo 'has found.'
echo
echo 'If you really, REALLY want to commit this code, skip your pre-commit'
echo 'hooks with `git commit --no-verify`.'
@telent
telent / gist:9742059
Last active May 8, 2024 11:36
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java

Unix Epoch to ISO 8601

Time.at(1419839999).to_datetime.iso8601
codecov:
token: uuid # Your private repository token
url: "http" # for Codecov Enterprise customers
slug: "owner/repo" # for Codecov Enterprise customers
branch: master # override the default branch
bot: username # set user whom will be the consumer of oauth requests
ci: # Custom CI domains if Codecov does not identify them automatically
- ci.domain.com
- !provider # ignore these providers when checking if CI passed
# ex. You may test on Travis, Circle, and AppVeyor, but only need