Skip to content

Instantly share code, notes, and snippets.

View ntamvl's full-sized avatar
🏠
Working from home

Tam Nguyen ntamvl

🏠
Working from home
View GitHub Profile
@ntamvl
ntamvl / [ReactJS] Detect Scrolls To Bottom.md
Last active February 21, 2024 11:10 — forked from enqtran/[ReactJS] Detect Scrolls To Bottom
[ReactJS] Detect Scrolls To Bottom
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 02:05 — 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

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 October 4, 2017 08:31 — forked from evertonfraga/ethereum-dev-mode.md
Set up an Ethereum development network in two minutes
@ntamvl
ntamvl / sketch-never-ending.md
Created June 14, 2017 05:32 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###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

@ntamvl
ntamvl / postgresql_setup_hstore.rb
Last active February 21, 2024 11:15 — forked from andreypronin/setup_hstore.rb
Migration to enable hstore for PostgreSQL with Rails 4.See also http://platformonrails.wordpress.com/2013/03/17/using-postgres…e-with-rails-4/
class SetupHstore < ActiveRecord::Migration
def self.up
enable_extension "hstore"
end
def self.down
disable_extension "hstore"
end
end
@ntamvl
ntamvl / rabbit.rake
Created July 11, 2016 16:49 — forked from johnkellar/rabbit.rake
RabbitMQ Configuration Rake Tasks
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
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 June 21, 2016 10:21 — forked from stevenyap/Mina.md
Mina - Faster deployment than Capistrano!!!
@ntamvl
ntamvl / elasticsearch.md
Created March 4, 2016 04:00 — forked from dominicsayers/elasticsearch.md
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@ntamvl
ntamvl / rspec_html.rake
Created January 11, 2016 07:03 — forked from jonahoffline/rspec_html.rake
Rake Task for generating a RSpec report in html.
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