Skip to content

Instantly share code, notes, and snippets.

View ptgamr's full-sized avatar

Anh Trinh ptgamr

View GitHub Profile
[
{
"tracks": [],
"name": "Starred",
"id": 1428756650503
},
{
"tracks": [
{
"id": "nA43UrtWHqw",
@ptgamr
ptgamr / couch-db-install.md
Created April 13, 2015 22:44
CouchDB installation Ubuntu
# install the ppa-finding tool
# for 12.04 release
sudo apt-get install python-software-properties -y
# for 14.04 release
sudo apt-get install software-properties-common -y
# add the ppa
sudo add-apt-repository ppa:couchdb/stable -y
# update cached list of packages
sudo apt-get update -y
@ptgamr
ptgamr / soundcloudify-sync.md
Created April 14, 2015 05:03
SoundCloudify sync approach

ON APP INIT

  • User has not login to Chrome: no server communication needed. only store data to local storage.

  • When user login to Chrome (profile_id is defined)

ON APP INIT

  • check if user is in the database
@ptgamr
ptgamr / notes.md
Created April 21, 2015 14:25
notes

NowPlaying:

  • no need for POST call
  • When add track, if nowplaying list does not existed yet, created it
  • the call PUT /nowplaying can accept a list of tracks
#!/bin/bash
# TODO
# - Automatically fix the "Unknown display" problem by editing grub defaults
# like described here: http://askubuntu.com/questions/398903/unknown-display-besides-laptop-built-in-display-old-question-but-with-no-answer
##
## Essential stuff
##
sudo apt-get install -y build-essential aria2 git mercurial subversion \
@ptgamr
ptgamr / sync.spec.md
Last active August 29, 2015 14:21
synchronization spec

GIVEN: client1 & client2

Add Track

WHEN client2 [addtrack] AND client1 [addtrack] THEN

GIVEN client1 = [1,2,3,4,5] (sync)
THEN client2 add track: server = [1,2,3,4,5,6]
THEN client1 add track: client1 = [1,2,3,4,5,6]

THEN client1 pull: client1 = [1,2,4,5,6 (from client1), 6 (from client2)]

tmux shortcuts & cheatsheet

~/.tmux.conf

# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
@ptgamr
ptgamr / bug-report-guideline.md
Last active August 29, 2015 14:21
Reporting bug guideline - SoundCloudify

When the extension is not working for you or there are some strange issue that happened. Please follow these steps in order to give me the most detail error code... So that I can work on a fix.

    1. Open chrome://extensions page
    1. Enable developer mode (located at the top right)
    1. Locate the extension, and click [Inspect views: background.html]
    1. Now the Developer Tool is open. Go to the console tab and paste me the error

Thanks you a lot for your time!

cd /var/log/nginx
zcat -f access.log* | goaccess -a
@ptgamr
ptgamr / upnext-hot-key-configuration.md
Last active April 19, 2016 07:47
UpNext hot key guide

The default hot keys for UpNext ares:

  • Alt + N : next song
  • Alt + Shift + N: previous song
  • Alt + P : play/pause the song

You might want to change the default hot key, here how you can do that in Chrome:

    1. Open chrome://extensions page
    1. Scroll to the bottom of the page