Skip to content

Instantly share code, notes, and snippets.

View ptgamr's full-sized avatar

Anh Trinh ptgamr

View GitHub Profile
@ptgamr
ptgamr / dokku.sh
Last active August 29, 2015 14:22
dokku command
cat ~/.ssh/id_rsa.pub | ssh -i soundcloudify-ec2.pem ubuntu@52.11.128.104 "sudo sshcommand acl-add dokku catalystpc"
ssh dokku@52.11.128.104 logs backend
ssh -t dokku@backend.sportcontract.eu logs backend -t -f
@ptgamr
ptgamr / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ptgamr
ptgamr / tmux.md
Last active August 29, 2015 14:23 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

import Ember from 'ember';
export { dirtyHasMany, dirtyBelongsTo, dirtyMixin };
var dirty = 'relationshipIsDirty';
function dirtyMixin (obj) {
var args = Object.keys(obj);
var comp = Ember.computed;
args.push('isDirty');
obj[dirty] = comp.any.apply(comp, args);
@ptgamr
ptgamr / es-mongo-scripts
Last active August 29, 2015 14:24
elasticsearch-mongodb
7871* bin/plugin --install com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.9
7872* bin/plugin install elasticsearch/elasticsearch-mapper-attachments/2.6.0
7873* bin/plugin install mobz/elasticsearch-head
7874* bin/elasticsearch
7875* -XDELETE curl localhost:9200/_river
7876* curl -XDELETE localhost:9200/_river
7877* curl -XPUT "localhost:9200/_river/players/_meta" -d '\n{\n "type": "mongodb",\n "mongodb": { \n "db": "new_river", \n "collection": "players"\n }, \n "index": { \n "name": "players", \n "type": "playerIndexType"\n }\n}'
7878* sudo mongod --replSet rs0
7879* mongo
7880* curl -XPUT "localhost:9200/_river/players/_meta" -d '\n{\n "type": "mongodb",\n "mongodb": { \n "db": "new_river", \n "collection": "players"\n }, \n "index": { \n "name": "players", \n "type": "playerIndexType"\n }\n}'
@ptgamr
ptgamr / installation.md
Last active August 29, 2015 14:25
Installation guide

Install

  • MongoDB
  • NodeJS

###BACKEND

  • cd
  • sudo npm install
  • nodemon

backend endpoint is protected with JWT token, when using POSTMAN to test API, you'll need to include a token in the header

@ptgamr
ptgamr / fms-workflow.md
Last active August 29, 2015 14:26
FMS-workflow

FMS WORKFLOW

  • Every staffs has to register an account
  • Shop owner is also a normal user

===========================================

  • Shop owner create one more multiple TEAMS
  • Shop owner add USER to TEAMS
  • Shop owner add FACEBOOK PAGE to TEAMS
@ptgamr
ptgamr / .tmux.conf
Created August 7, 2015 09:55
tmux-config
# disable mouse control by default - change 'off' to 'on' to enable by default.
setw -g mode-mouse off
set-option -g mouse-resize-pane off
set-option -g mouse-select-pane off
set-option -g mouse-select-window off
# toggle mouse mode to allow mouse copy/paste
# set mouse on with prefix m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
@ptgamr
ptgamr / team.js
Created October 1, 2015 08:49 — forked from poteto/team.js
import Ember from 'ember';
import DS from 'ember-data';
var computed = Ember.computed;
var get = Ember.get;
var RSVP = Ember.RSVP;
export default DS.Model.extend({
name: DS.attr('string'),
players: DS.hasMany('player', { async: true }),