Skip to content

Instantly share code, notes, and snippets.

Sachin Rai millisami

Block or report user

Report or block millisami

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@millisami
millisami / add_lvhme.sh
Created Dec 18, 2016 — forked from mdespuits/add_lvhme.sh
Add lvh.me to Mac OS X hosts file
View add_lvhme.sh
#!/bin/bash
main() {
if [[ $(has_lvh_me) == 1 ]]; then
echo 'lvh.me is already specified in your hosts file'
else
add_lvh_me
echo 'lvh.me was added to your hosts file!'
fi
flush_dns_cache
@millisami
millisami / wp-theme-review-setup.sh
Created Dec 13, 2016 — forked from lukemcdonald/wp-theme-review-setup.sh
Scaffold a new WordPress site using an Alfred workflow and WP-CLI. Development sites are spun up using Laravel Valet and a parked Sites folder in the root.
View wp-theme-review-setup.sh
# Parse query name into theme and version variables (e.g. theme-name 1.0.0)
read theme version <<< "{query}"
# Create directory for new site
cd ~/Sites
mkdir $theme
cd $theme
# Download latest version of WordPress
wp core download
@millisami
millisami / hoodie-not_found.error
Created Sep 28, 2016
Error confirming user: Error: not_found
View hoodie-not_found.error
Initializing...
Using remote CouchDB: http://127.0.0.1:5984
Waiting for CouchDB [-*----] SUCCESS
WWW: http://127.0.0.1:6001
Admin: http://127.0.0.1:6002
Starting Plugin: 'hoodie-plugin-appconfig'
Starting Plugin: 'hoodie-plugin-email'
Starting Plugin: 'hoodie-plugin-users'
All plugins started.
@millisami
millisami / hoodie.error
Created Sep 27, 2016
Error: spawn EACCES
View hoodie.error
○ hoodie new appName -t "hoodiehq/hoodie-app-skeleton"
.d$b. .d$b. .d$$$$$$b. .d$$$$$$b. .d$$$$$$b. .d$b..d$$$$$$$$b.
$$$$$..$$$$$.$$$$$$$$$$$b .$$$$$$$$$$$b $$$$$$$$$$b $$$$$$$$$$$$$$$P'
$$$$$$$$$$$$d$$$$$$$$$$$$bd$$$$$$$$$$$$b$$$$$$$$$$$b$$$$$$$$$$$$$$$b.
$$$$$$$$$$$$Q$$$$$$$$$$$$PQ$$$$$$$$$$$$P$$$$$$$$$$$P$$$$$$$$$$$$$$$P'
$$$$$´`$$$$$'$$$$$$$$$$$$''$$$$$$$$$$$$'$$$$$$$$$$P $$$$$$$$$$$$$$$b.
'Q$P' 'Q$P' 'Q$$$$$$P' 'Q$$$$$$P' 'Q$$$$$$$P 'Q$P''Q$$$$$$$$P'
Version: 0.6.3 (node v0.12.15, npm 2.15.11, platform: darwin)
@millisami
millisami / application.js
Created Jan 23, 2015
Access configurable values in emberjs ember-cli
View application.js
# app/adapters/application.js
import DS from 'ember-data';
import config from '../config/environment';
export default DS.ActiveModelAdapter.extend({
host: config.apiUrl
});
@millisami
millisami / emberjs-with-ember-cli.md
Last active Aug 29, 2015
Emberjs app using ember-cli
View emberjs-with-ember-cli.md

Building Contacto app using EmberCLI

Installation

First install Node.js. Then:

npm install -g bower
npm install -g phantomjs
View npm log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.10.5/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'ember-cli' ]
2 info using npm@1.2.18
3 info using node@v0.10.5
4 verbose read json /usr/local/share/npm/lib/package.json
5 verbose read json /usr/local/share/npm/lib/package.json
View store.coffee
env = require 'config/environment'
if env.isDevelopment()
window.App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'http://localhost:3000'
})
else if env.isTest()
window.App.ApplicationAdapter = DS.FixtureAdapter.extend({
simulateRemoteResponse: false
})
View application-notes-zero-downtime-deploys-unicorn-nginx-runit-rvm-chef.md

Zero downtime deploys with unicorn + nginx + runit + rvm + chef

Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).

Other application notes:

  • Our application uses MongoDB, so we don't have database migrations to worry about as with MySQL or postgresql. That does not mean that we won't have to worry about issues with the database with indexes being built in MongoDB or what have you.
  • We use capistrano for deployment.

Salient points for each file:

You can’t perform that action at this time.