Skip to content

Instantly share code, notes, and snippets.

View ptgamr's full-sized avatar

Anh Trinh ptgamr

View GitHub Profile
javascript: (function() {
var root = $(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default

Indicator Synapse is a Spotlight Alternative, developed by Tom Beckmann.

spotlight-alternative

How to Install Indicator Synapse (Spotlight Alternative) on Ubuntu 14.04 LTS or Linux Mint 17 run this commands in terminal:

$ [sudo] add-apt-repository ppa:noobslab/apps
$ [sudo] apt-get update
$ [sudo] apt-get install indicator-synapse
@ptgamr
ptgamr / ubuntu-tweaks.md
Last active August 29, 2015 14:15
Ubuntu useful
@ptgamr
ptgamr / father-and-son-inheritance.js
Created February 12, 2015 23:23
Father & Son Analogy
// https://alexsexton.com/blog/2013/04/understanding-javascript-inheritance/
// Let's take a set of 4 genes for ease of
// example here. We'll put them in charge
// a few things.
function Human (name, genes_mom, genes_dad) {
this.name = name;
// Set the genes
this.genes = {
darkHair: this._selectGenes(genes_mom.darkHair, genes_dad.darkHair),
@ptgamr
ptgamr / BaseController.js
Last active August 29, 2015 14:15
AngularJS Controller Inheritance
/**
* Base controller for all controllers.
* Use this as a template for all future controllers
*
* Use of Class.js
*/
var BaseController = Class.extend({
$scope:null,
/**
@ptgamr
ptgamr / README.md
Last active August 29, 2015 14:15 — forked from hofmannsven/README.md
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@ptgamr
ptgamr / sublime-regex.md
Last active August 29, 2015 14:16
Sublime regex

Replace line start with throw '...' with throw new Error(...)

Regex: (throw) ('.*');$

Replace: \1 new Error(\2)

@ptgamr
ptgamr / vbus-widget.md
Last active August 29, 2015 14:18
vbus-widget.js

VBUS search widget

  • The widget should be allocated a space to put the search box
  • The search action will open up a modal, which contains result
  • Initialization code should be easy
  • Widget's markup should be namespaced with vbusvn- to avoid conflict with current page
<script type="text/javascript" src="http://vbus.vn/vbus-widget.js"></script>
...