Skip to content

Instantly share code, notes, and snippets.

View nhoffmann's full-sized avatar

Niels Hoffmann nhoffmann

View GitHub Profile
@nhoffmann
nhoffmann / deploy.rb
Created December 1, 2016 22:09 — forked from dsandstrom/deploy.rb
Compile assets locally with capistrano 3.5.0 and rails 4.2.x (Nginx-Unicorn zero downtime)
# Runs rake assets:clean
# Defaults to nil (no asset cleanup is performed)
# If you use Rails 4+ and you'd like to clean up old assets after each deploy,
# set this to the number of versions to keep
set :keep_assets, 2
# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
namespace :deploy do
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true
},
"globals": {
{
"parser": "babel-eslint", // https://github.com/babel/babel-eslint
"plugins": [
"react" // https://github.com/yannickcr/eslint-plugin-react
],
"env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments
"browser": true, // browser global variables
"node": true // Node.js global variables and Node.js-specific rules
},
"globals": {
@nhoffmann
nhoffmann / do_boot2.sh
Last active February 14, 2016 14:02 — forked from leucos/do_boot2.sh
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory (version for Ansible v2.0+ and DO API v2.0)
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.
# /etc/init/rpush.conf - Rpush config
# This example config should work with Ubuntu 12+. It
# allows you to manage Rpush instances with
# Upstart, Ubuntu's native service management tool.
#
# Save this config as /etc/init/rpush.conf then mange rpush with:
# sudo start rpush app=/path/to/application
# sudo stop rpush app=/path/to/application
# sudo status rpush app=/path/to/application
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.9.deb
sudo dpkg -i elasticsearch-0.90.9.deb
@nhoffmann
nhoffmann / puma.conf
Created May 2, 2013 13:29
Basic puma configuration because the example in the puma repo is shit.
# /etc/init/puma.conf - Puma config
# This example config should work with Ubuntu 12+. It
# allows you to manage Puma instances with
# Upstart, Ubuntu's native service management tool.
#
# Save this config as /etc/init/puma.conf then mange puma with:
# sudo start puma app=/path/to/application
# sudo stop puma app=/path/to/application
# sudo status puma app=/path/to/application
@nhoffmann
nhoffmann / deploy.rb
Created April 3, 2012 14:07
Capistrano recipe for deploying static content.
set :application, "My Static Content"
set :servername, 'test.example.com'
# no git? simply deploy a directory
set :scm, :none
set :repository, "." # the directory to deploy
# using git? deploy from local git repository
# set :scm, :git
# set :repository, 'file//.' # path to local git repository
@nhoffmann
nhoffmann / restrictions.conf
Created December 29, 2011 15:42
Nginx global configuration files to ease the configuration of wordpress multisite installations under nginx/php-fpm. Simply import these configurations in your specific configuration
# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
@nhoffmann
nhoffmann / Folder Preferences
Created December 27, 2011 15:10 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern