Skip to content

Instantly share code, notes, and snippets.

View brunoguerra's full-sized avatar
🌌
Growing online businesses 🥇

Bruno Guerra brunoguerra

🌌
Growing online businesses 🥇
  • Blumenau, SC
View GitHub Profile
{
"color_inactive_tabs": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"draw_indent_guides": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",

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
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {

Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.

Install

$ npm install mongoose --save

Connect

const mongoose = require('mongoose');
@brunoguerra
brunoguerra / simulate koa controller
Created October 30, 2015 13:35
simulate koa controller
// /modules/console/utils
import co from 'co';
import { returnAsPromise } from '../../lib/commons';
export default {
koaReq: (params, next) => {
console.log('koaReq: starting');
function* chain(next) {
this.params = params;
@brunoguerra
brunoguerra / pm2.js
Created November 30, 2015 21:52
PM2 Configuration
var pmx = require('pmx').init({
http : true,
network : true,
ports : true
});
var pm2 = require('pm2');
var path = require('path');
var MACHINE_NAME = process.env.APP_NAME;
input {
tcp {
'port' => "9998"
codec => json
}
udp {
'port' => "9999"
codec => json
}
@brunoguerra
brunoguerra / elasticsearch.md
Created December 30, 2015 06:51 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@brunoguerra
brunoguerra / android-ubuntu-16-requirements
Created August 28, 2016 16:55
Android Ubuntu 16 requirements
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
@brunoguerra
brunoguerra / build-heroku
Created September 9, 2016 23:24
nodejs build heroku testinho
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=4.2.0
engines.npm (package.json): ^3.0.0