Skip to content

Instantly share code, notes, and snippets.

Mohammad Shahrizal Prabowo rizalp

  • Indonesia
Block or report user

Report or block rizalp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rizalp
rizalp / gem-sqlite3-source.md
Last active Apr 23, 2019
sqlite3 from source ubuntu
View gem-sqlite3-source.md
  • Download and extract the autoconf https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
  • ./configure --prefix=/home/rizalp/.local && make && make install
  • gem install sqlite3 -- --with-sqlite3-include=/home/rizalp/.local/include --with-sqlite3-lib=/home/rizalp/.local/lib
@rizalp
rizalp / remove
Last active Mar 18, 2019
Remove Unused Package Ubuntu
View remove
sudo apt purge pidgin transmission-common libreoffice* thunderbird parole snapd firefox fonts-noto-cjk gnome-software
@rizalp
rizalp / homebrew-sqlite3.md
Created Feb 11, 2019
Install sqlite3 Ruby gem with homebrew's version of sqlite
View homebrew-sqlite3.md
gem install sqlite3 -- --with-sqlite3-include=/usr/local/Cellar/sqlite/3.27.1/include --with-sqlite3-lib=/usr/local/Cellar/sqlite/3.27.1/lib
@rizalp
rizalp / disable_spectre.md
Created Feb 3, 2019
Disable Spectre/Meltdown Mitigation
View disable_spectre.md

In /etc/default/grub, modify:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nopti nospectre_v1 nospectre_v2 l1tf=off nospec_store_bypass_disable no_stf_barrier"

Then sudo update-grub

@rizalp
rizalp / mojave-rails-jemalloc-gmp.md
Last active Jan 15, 2019
macOs Mojave Rails Setup with jemalloc and gmp
View mojave-rails-jemalloc-gmp.md

Homebrew install

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Libraries

brew install rbenv ruby-build sqlite3 jemalloc gmp
View rbenv-rails-ubuntu1804.md

Install Development Dependencies

sudo apt-fast install git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libffi-dev libjemalloc-dev libgmp-dev nodejs

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@rizalp
rizalp / ubuntu1804-ror.md
Last active Jan 14, 2019
Ruby On Rails using package manager instead of rbenv
View ubuntu1804-ror.md

Minimal Ruby On Kubuntu:

~/.gemrc

install: --user-install
update: --user-install

~/.bashrc

@rizalp
rizalp / init-zram-swapping
Last active Jan 18, 2019
/usr/bin/init-zram-swapping custom config
View init-zram-swapping
#!/bin/sh
# load dependency modules
# NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')
NRDEVICES=1
if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then
MODPROBE_ARGS="zram_num_devices=${NRDEVICES}"
elif modinfo zram | grep -q ' num_devices:' 2>/dev/null; then
MODPROBE_ARGS="num_devices=${NRDEVICES}"
else
@rizalp
rizalp / DeepCopy.js
Last active Dec 28, 2015
How to do deep copy to Javascript object, and call the parent's own prototype method
View DeepCopy.js
/* Title: Deep Copy Object Properties
* Refference: https://github.com/shichuan/javascript-patterns/blob/master/code-reuse-patterns/inheritance-by-copying-properties.html
* Description: an object gets functionality from another object, simply by copying it
* Only the properties will be copied. The prototype will not
* it is generally not recomended to copy the prototype over
*/
/* deep copy */
function extendDeep(parent, child) {
var i, toStr = Object.prototype.toString,
View child.js
//this works encapsulating private properties
//now, how about prototypes?
var Child = (function (s, f){
var DOB = new Date();
var sex = s;
var fullName = f;
var mood;
return {
You can’t perform that action at this time.