Skip to content

Instantly share code, notes, and snippets.

View sigerello's full-sized avatar

Oleksandr Serhiienko sigerello

View GitHub Profile
@sigerello
sigerello / fuse.js
Created May 28, 2018 20:23 — forked from Pavel1104/fuse.js
fusebox settings
const { FuseBox, WebIndexPlugin, StylusPlugin, CSSPlugin, EnvPlugin, QuantumPlugin } = require("fuse-box");
const isProduction = process.env.NODE_ENV === "production"
let fuse = FuseBox.init({
homeDir : "src",
target : 'browser@es5',
output : "dist/$name.js",
plugins : [
[StylusPlugin(), CSSPlugin()],
@sigerello
sigerello / Ux.InputTextMask.js
Last active September 20, 2015 12:10 — forked from loiane/Ux.InputTextMask.js
Ux.InputTextMask for ExtJS4
/**
* InputTextMask script used for mask/regexp operations.
* Mask Individual Character Usage:
* 9 - designates only numeric values
* L - designates only uppercase letter values
* l - designates only lowercase letter values
* A - designates only alphanumeric values
* X - denotes that a custom client script regular expression is specified</li>
* All other characters are assumed to be "special" characters used to mask the input component.
* Example 1:

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:

# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/ngram_test
curl -X PUT localhost:9200/ngram_test -d '
{
"settings" : {
"index" : {
"analysis" : {
@sigerello
sigerello / es.sh
Created January 15, 2013 14:01 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@sigerello
sigerello / deploy.rake
Created October 15, 2012 23:56 — forked from ndbroadbent/deploy.rake
Rake task for precompiling assets locally before deploying to Heroku
require 'fileutils'
# Warning: The following deploy task will completely overwrite whatever is currently deployed to Heroku.
# The deploy branch is rebased onto master, so the push needs to be forced.
desc "Deploy app to Heroku after precompiling assets"
task :deploy do
deploy_branch = 'heroku'
remote = 'heroku'
deploy_repo_dir = "tmp/heroku_deploy"
@sigerello
sigerello / gist:3062848
Created July 6, 2012 21:30 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@sigerello
sigerello / Procfile
Created June 27, 2012 00:21 — forked from jamiew/Procfile
Using unicorn on heroku part 9000
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@sigerello
sigerello / deploy.rake
Created June 27, 2012 00:20 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@sigerello
sigerello / README.markdown
Created October 8, 2011 06:12 — forked from dora-gt/README.markdown
How to install MongoDB 2.0 on Mac OS X (>= Leopard)

How to install MongoDB 2.0 on Mac OS X (>= Leopard)

Procedure

The whole install procedure is like the following.
You would have to do 7 steps.

  1. Download the latest tar file, and expand it.
  2. Move it to /usr/local/, and make a symbolic link to the folder.
  3. Add path to MongoDB binaries.
  4. Make an user that "mongod" runs on, and group that owns the user.