Skip to content

Instantly share code, notes, and snippets.

View ptgamr's full-sized avatar

Anh Trinh ptgamr

View GitHub Profile
@ptgamr
ptgamr / clean-up-boot-partition-ubuntu.md
Created September 18, 2018 10:44 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
fetch('https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js')
.then(response => response.text())
.then(text => eval(text))
@ptgamr
ptgamr / concat.sh
Last active September 3, 2018 08:38
concat audio add delay (install http://macappstore.org/sox/)
#! /bin/bash
sox -n -r 22050 -c 1 /tmp/silence.wav trim 0.0 15
sox /tmp/silence.wav -C 48.01 /tmp/silence.mp3
sox $(for f in `ls *.mp3 | sort -V`; do echo -n "$f /tmp/silence.mp3 "; done) output.mp3
@ptgamr
ptgamr / alacritty.yml
Created August 13, 2018 10:12
~/.config/alacritty/alacritty.yml
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization. Default is xterm-256color
# Note: the default TERM value `xterm-256color` does not
# specify all features alacritty supports. This does pose
@ptgamr
ptgamr / coursera-stylus.css
Created August 7, 2018 19:57
coursera-stylus.css
body {
background-color: #333;
color: #ddd;
border-color: white !important;
}
body * {
border-color: #444 !important;
}
@ptgamr
ptgamr / keybase.md
Created June 9, 2018 03:13
keybase.md

Keybase proof

I hereby claim:

  • I am ptgamr on github.
  • I am ptgamr (https://keybase.io/ptgamr) on keybase.
  • I have a public key ASC4NF7gpcHQqMZm8ep9eQlRPlRXZfx8fgMSlrUAN5SwFwo

To claim this, I am signing this object:

@ptgamr
ptgamr / Ubuntu-Compass-ruby[16.04]
Created March 24, 2018 10:36 — forked from AungMyoKyaw/Ubuntu-Compass-ruby[16.04]
Compass installation for ubuntu 16.04
[https://gist.github.com/stephou0104/233b5c99884f1d8c8b8b#file-ubuntu-compass-ruby]
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
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
@ptgamr
ptgamr / dirty.js
Created September 15, 2017 11:03
dirty.js
const isValid = (v) => {
return v !== null && v !== undefined;
}
const isObject = (v) => {
return typeof(v) === 'object';
}
const isCallable = (v) => {
return typeof(v) === 'function';

I have successfully applied the following coupon on the subscription: sub_B11QoX8cG4AjeW

ID: scoutingtagging-chf-month
Amount off: CHF 90.00 CHF off
Duration: once
Valid: true

Now I want to switch all the subscribed plans to yearly plan, with prorate = true.

@ptgamr
ptgamr / promisify.js
Created July 13, 2017 03:57
Promisify
const promisify = func => {
// this need to not using arrow function, otherwise the `this` context will be wrong
return function() {
const args = Array.from(arguments);
return new Promise((resolve, reject) => {
const callback = (err, data) => {
if (error) {
return reject(err);
}