Skip to content

Instantly share code, notes, and snippets.

@jasonben
jasonben / nginx.conf
Created January 22, 2016 03:53 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jasonben
jasonben / Dockerfile
Created January 4, 2016 21:10 — forked from andyshinn/Dockerfile
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@jasonben
jasonben / shell
Created November 18, 2015 05:00 — forked from mojowen/shell
Running @facebook/phpsh with WordPress functions
#!/bin/bash
# First install https://github.com/facebook/phpsh
# And ctags https://github.com/mxcl/homebrew/blob/master/Library/Formula/ctags.rb
# From http://vocecommunications.com/blog/2010/12/how-to-setup-an-interactive-wordpress-shell/
if [ ! -f ./.wp-shell.php ];
then
echo '<?php include_once("wp-load.php"); include_once("wp-admin/includes/admin.php"); ?>' > ./.wp-shell.php
fi
@jasonben
jasonben / capybara cheat sheet
Created October 14, 2015 02:08 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
#!/usr/bin/env ruby
# Libraries:::::::::::::::::::::::::::::::::::::::::::::::::::::::
require 'rubygems'
require 'sinatra/base'
require 'slim'
require 'sass'
require 'coffee-script'
# Application:::::::::::::::::::::::::::::::::::::::::::::::::::

Organizing your codes

A few notes on how I organize my code lately. It's not the sexiest topic in the world but it matters, especially given that I keep about 160 repos cloned on my system at any given time.

Directory Layout

I've spent a couple years now trying to avoid the urge to mirror my personal code working space after github repo pathnames, but I'm a weak man and have given in.

When I want to clone a repo, I'll give it a directory matching the pattern ~/code/<owner>/<repo>.