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 / 1.js
Last active May 4, 2017 18:06
easysoap GA code
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-38768986-1', 'auto');
ga('send', 'pageview');
</script>
@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:
Process: MDB Explorer [18501]
Path: /Applications/MDB Explorer.app/Contents/MacOS/MDB Explorer
Identifier: com.grandsoft.MDB-Explorer
Version: 2.4.5 (2.4.500)
App Item ID: 506622388
App External ID: 813023495
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: MDB Explorer [18501]
User ID: 501
Process: MDB Explorer [36533]
Path: /Applications/MDB Explorer.app/Contents/MacOS/MDB Explorer
Identifier: com.grandsoft.MDB-Explorer
Version: 2.4.3 (2.4.300)
App Item ID: 506622388
App External ID: 812130215
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: MDB Explorer [36533]
User ID: 501

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