Skip to content

Instantly share code, notes, and snippets.

View speed-of-light's full-sized avatar

Speed of Light speed-of-light

View GitHub Profile
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn initscript
# Description: Unicorn is an HTTP server for Rack application
### END INIT INFO
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #

Bash (Readline)

Moving

ctrl + a                 Goto BEGINNING of command line
ctrl + e                 Goto END of command line
ctrl + b                 move back one character

ctrl + f move forward one character

# linted
# Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@speed-of-light
speed-of-light / Syntax.liquid
Last active August 29, 2015 14:02
Jekyll sandbox
Build in syntax
Gist Liquid Tag
Example:
{% gist username/1234567 %}
{% gist username/1234567 file.rb %}
or use the following plugin to customize...
@speed-of-light
speed-of-light / Rename_with_variable.sh
Created June 18, 2014 15:03
decrease Increase file by 1 or other variable
#!/bin/bash
dir=$1
for f in "$dir"/*; do
pre=${f:0:4}
post=${f:7}
fn=$((${f:4:3} - 1))
jj=`printf "%03d" $fn`
mv $f $pre${jj}_tmp$post # prevent overrite
done
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
var cfg = require('../config').Config,
qs = require('querystring'),
request = require('request');
request = request.defaults({jar: true})
exports.awesome = function(req, res){
headers = {};
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@speed-of-light
speed-of-light / 0_reuse_code.js
Created August 20, 2014 13:44
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