Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tam Nguyen ntamvl

🏠
Working from home
View GitHub Profile
View [ReactJS] Detect Scrolls To Bottom.md
constructor(props) {
    super(props);
    this.state = {
        height: window.innerHeight,
        message: 'not at bottom'
    };
    this.handleScroll = this.handleScroll.bind(this);
}
@ntamvl
ntamvl / parallels_tools_ubuntu_new_kernel_fix.md
Created May 30, 2018 — forked from rudolfratusinski/parallels_tools_ubuntu_new_kernel_fix.md
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15
View parallels_tools_ubuntu_new_kernel_fix.md

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*

@ntamvl
ntamvl / ethereum-dev-mode.md
Created Oct 4, 2017 — forked from evertonfraga/ethereum-dev-mode.md
Set up an Ethereum development network in two minutes
View ethereum-dev-mode.md
@ntamvl
ntamvl / sketch-never-ending.md
Created Jun 14, 2017 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial
View sketch-never-ending.md

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
View postgresql_setup_hstore.rb
class SetupHstore < ActiveRecord::Migration
def self.up
enable_extension "hstore"
end
def self.down
disable_extension "hstore"
end
end
@ntamvl
ntamvl / rabbit.rake
Created Jul 11, 2016 — forked from johnkellar/rabbit.rake
RabbitMQ Configuration Rake Tasks
View rabbit.rake
namespace :rabbit do
def get_queues
`#{@base_command} list queues | awk '{print$4}' | grep -vw '|' | grep -vw 'name' | awk 'NF'`
end
def get_queues_with_count
`#{@base_command} list queues | awk '{print$18, $4}' | grep -vw '|' | grep -vw 'name' | awk 'NF'`
end
View main.go
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
@ntamvl
ntamvl / Mina.md
Created Jun 21, 2016 — forked from stevenyap/Mina.md
Mina - Faster deployment than Capistrano!!!
View Mina.md
@ntamvl
ntamvl / elasticsearch.md
Created Mar 4, 2016 — forked from dominicsayers/elasticsearch.md
Configuring ElasticSearch to use less memory
View elasticsearch.md

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@ntamvl
ntamvl / rspec_html.rake
Created Jan 11, 2016 — forked from jonahoffline/rspec_html.rake
Rake Task for generating a RSpec report in html.
View rspec_html.rake
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '--format html --out reports/rspec_results.html'
end
namespace :rspec_report do
desc 'Run all specs and generate RSpec report in HTML'
task :html => :spec