Skip to content

Instantly share code, notes, and snippets.

Avatar
🏰
Preparing for big things...

Mulia Nasution mul14

🏰
Preparing for big things...
View GitHub Profile
@mul14
mul14 / README.md
Created Mar 24, 2021 — forked from danbst/README.md
[Linux] [Firefox] Open link in browser, which is in current workspace
View README.md

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

@mul14
mul14 / 99-install-facetime-camera.sh
Created Nov 21, 2020 — forked from ukn/99-install-facetime-camera.sh
Install the kernal module required for the facetimehd camera to work on Linux
View 99-install-facetime-camera.sh
#!/bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
# For current kernel
export KERNELRELEASE=$(cat /proc/version | awk '{print $3}')
temp_dir=$(mktemp -d)
echo "Installing FacetimeHD camera for $KERNELRELEASE"
@mul14
mul14 / create_new_user.sql
Last active Nov 16, 2020
MySQL/MariaDB mysql_native_password
View create_new_user.sql
CREATE USER 'mul14'@'localhost' IDENTIFIED BY 'secret_password';
GRANT ALL PRIVILEGES ON *.* TO 'mul14'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@mul14
mul14 / graphql_query.js
Last active Nov 21, 2020
Simple GraphQL Client for web browser
View graphql_query.js
function graphql_query(endpoint, query, variables = {}, token = null) {
return new Promise((resolve, reject) => {
const headers = {
'Content-Type': 'application/json',
}
if (token) {
headers['Authorization'] = `Bearer ${token}`
}
@mul14
mul14 / ApproachingFibonacci.js
Last active Apr 13, 2021
Someone give me some coding test on CoderByte. Here are the questions and my answers.
View ApproachingFibonacci.js
/*
Have the function
ArithGeo(arr)
take the array of numbers stored in
arr
and return the string
"Arithmetic"
if the sequence follows an arithmetic pattern or return
"Geometric"
if it follows a geometric pattern. If the sequence doesn't follow either pattern return
@mul14
mul14 / demo.sh
Last active Jun 22, 2021
I very often create new folder to demonstrate or experiment. Run mkdir, cd, git init, etc; each time when I need is painful. So, I create this simple bash script.
View demo.sh
#!/bin/bash
demo () {
project_name=""
if [ $# -eq 0 ]; then
project_name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
else
if [[ ( $1 == "--help") || $1 == "-h" ]]; then
cat << EOF
@mul14
mul14 / DefaultKeyBinding.dict
Created Aug 4, 2019 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
View DefaultKeyBinding.dict
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@mul14
mul14 / CPP_test.md
Last active Jul 9, 2019
Programming Test
View CPP_test.md

Buatlah objek Person yang memiliki nama, tanggal lahir, jenis kelamin, tingkat kekuatan. Objek tersebut juga dapat berjalan, berlari, dan melompat.

Buatlah objek SuperHero yang mewarisi semua yang dimiliki Person dan memiliki nama julukan super hero. SuperHero dapat melakukan hal-hal yang tidak bisa Person lakukan, seperti terbang, tembus pandang, dan tingkat kekuatan lebih tinggi daripada Person.

Semua property dan kemampuan yang ada di Person tetap dapat dipanggil melalui SuperHero.

@mul14
mul14 / README.md
Last active Feb 11, 2019
Replace Laravel String and Array Helpers to Facade with regex
View README.md
@mul14
mul14 / Form.js
Last active Jan 15, 2019
Vue.js Form class
View Form.js
class Form {
constructor (data) {
this._originalData = Object.assign({}, data)
for (let key in data) {
this[key] = data[key]
}
}