Skip to content

Instantly share code, notes, and snippets.

View rikyperdana's full-sized avatar
💭
Alhamdulillah

Riky Perdana rikyperdana

💭
Alhamdulillah
View GitHub Profile
@rikyperdana
rikyperdana / matrix.js
Last active April 19, 2024 02:36
Matrix Operations in JS
withAs = (obj, cb) => cb(obj)
sum = arr => arr.reduce((a, b) => a + b)
mul = arr => arr.reduce((a, b) => a * b)
sub = arr => arr.splice(1).reduce((a, b) => a - b, arr[0])
deepClone = obj => JSON.parse(JSON.stringify(obj))
shifter = (arr, step) => [
...arr.splice(step),
...arr.splice(arr.length - step)
]
@rikyperdana
rikyperdana / statistics.js
Last active September 25, 2021 03:46
Statistics in JS with Functional Paradigm
var
withThis = (obj, cb) => cb(obj),
get = prop => obj => obj[prop],
add = array => array.reduce((acc, inc) => acc + inc),
sub = array => array.reduce((acc, inc) => acc - inc),
mul = array => array.reduce((acc, inc) => acc * inc),
pow = asc => num => Math.pow(num, asc),
range = array => Math.max(...array) - Math.min(...array),
between = (low, middle, high) =>
(low <= middle) && (middle <= high),
@hkan
hkan / whatsapp-web-emoji-keywords.txt
Created April 30, 2018 16:25
Emoji shortcut keywords for Whatsapp Web
0⃣ 0, keycap, zero
1⃣ 1, number, one
🕜 1, 30, clock, time, one, thirty, 1:30, one-thirty
🕐 1, clock, time, one, 00, o’clock, 1:00, one o’clock
2⃣ 2, number, two
🕝 2, 30, clock, time, two, thirty, 2:30, two-thirty
🕑 2, clock, time, two, 00, o’clock, 2:00, two o’clock
3⃣ 3, keycap, three
🕞 3, 30, three, clock, time, thirty, 3:30, three-thirty
🕒 3, three, clock, time, 00, o’clock, 3:00, three o’clock
@rikyperdana
rikyperdana / Daftar Perintah Docker
Last active September 8, 2024 12:17
Daftar Perintah Docker
INSTALL Docker
sudo apt install docker.io
service docker start
docker run hello-world
PULL IMAGES
Browsing google atau hub.docker.com
docker pull nama_image
SHOW CONTAINERS
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active August 3, 2024 16:45
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 8, 2025 08:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname