Skip to content

Instantly share code, notes, and snippets.

@kayohlu
kayohlu / git_deployments.md
Created September 11, 2015 19:05
How to deploy an application with git

How to setup git deployments

Step 1

Add a folder to your server to store your repositories. I usually call it hub

mkdir ~/hub

Step 2

@kayohlu
kayohlu / gist:78c37bcd0999762dcf6d
Created August 28, 2015 16:02
File uploads with cURL
https://ariejan.net/2010/06/07/uploading-files-with-curl/
@kayohlu
kayohlu / gist:bdb9ae8bcebd688df605
Last active October 29, 2015 09:32
Understanding Ruby Includes and Extend
# Help taken from: http://aaronlasseigne.com/2012/01/17/explaining-include-and-extend/
module X
def hello
puts "Hello from module X"
end
end
module Y
def bye
@kayohlu
kayohlu / gist:7b020c89f98cef671c8a
Last active April 28, 2017 02:48
How To: Set Up a Grape API on Rack

How To: Set Up a Grape API on Rack

This is a step by step guide on how I setup a Grape API on Rack.

1. Dependencies

Our API will have a few dependencies:

@kayohlu
kayohlu / gist:435b926f2861c54ea499
Last active August 29, 2015 14:18
Removing minification and uglification from grunt build task
To completely disable minification & uglification:
You must edit useminPrepare task and overwrite grunt-usemin task options like so:
useminPrepare: {
options: {
dest: '<%= config.dist %>',
flow: {
steps: {
js: ['concat'],
@kayohlu
kayohlu / setup_server_for_rails.sh
Last active August 29, 2015 14:15
A small script to setup a server template for hosting Rails applicaitons. It contains an Nginx configuration too. This is similar to my How To on setting up a server to host a Django application.
PROJECT=$1
EXTENSION=$2
mkdir ~/web
mkdir ~/hub
mkdir /home/ubuntu/web/www.${PROJECT}.${EXTENSION}/
mkdir /home/ubuntu/web/www.${PROJECT}.${EXTENSION}/app/
mkdir /home/ubuntu/web/www.${PROJECT}.${EXTENSION}/logs/
mkdir /home/ubuntu/web/www.${PROJECT}.${EXTENSION}/static/