Skip to content

Instantly share code, notes, and snippets.

@snuggs
snuggs / .tmux.conf
Last active February 7, 2023 13:51
IDE & TMUX Configuration
############################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
# Cheatsheets:
# https://devhints.io/tmux
# `property not found` issue:
@technoweenie
technoweenie / minimal-logger.coffee
Created March 9, 2011 20:25
Minimal node.js logger
# logger = require('logger').create()
# logger.info("blah")
# => [2011-3-3T20:24:4.810 info (5021)] blah
# logger.debug("boom")
# =>
# logger.level = Logger.levels.debug
# logger.debug(function() { return "booom" })
# => [2011-3-3T20:24:4.810 error (5021)] booom
class Logger
constructor: (options) ->
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
##### this would be correct if the cloudant addon didn't seem to be broken
# heroku create <app-name> --addons cloudant:oxygen,cron:daily,hoptoad:basic,newrelic:standard,pgbackups:auto-month
#####
# create a cloudant account for the app
# create the heroku app with the necessary add-ons
heroku create <app-name> --addons cron:daily,hoptoad:basic,newrelic:standard,pgbackups:auto-month
# add the CLOUDANT_URL environment variable to the new instance
heroku config:add CLOUDANT_URL=https://username:password@username.cloudant.com
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 25, 2024 18:47
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aaronfeng
aaronfeng / etc-nginx-nginx.conf
Created July 30, 2012 14:15
nginx json log format
# /etc/nginx/nginx.conf
log_format main '{'
'"remote_addr": "$remote_addr",'
'"remote_user": "$remote_user",'
'"time_local": "$time_local",'
'"request": "$request",'
'"status": "$status",'
'"body_bytes_sent": "$body_bytes_sent",'
'"http_referer": "$http_referer",'
@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:

@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Installing Docker (Virtualbox, boot2docker, docker)

  1. Download and install the latest boot2docker for OS X.
  2. Open a new Terminal and enter boot2docker init
  3. Run boot2docker start
  4. You will be given an environment variable to export export DOCKER_HOST=tcp://192.168.59.103:2375. Add that to your bash_profile or equivalent.
  5. You have a successful environment when the output of docker version is clean (exits 0). The output should look a bit like:
Client version: 1.1.0

I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal

I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at