Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mandaputtra's full-sized avatar
🚀
On my way building something ...

Manda Putra mandaputtra

🚀
On my way building something ...
View GitHub Profile
@mandaputtra
mandaputtra / dev-server.js
Created July 17, 2019 07:23
Chokidar Usage Example
#!/usr/bin/env node
/* I found this code somewhere in the wild if someone could reference it I would happy
* I'm creating this because my google search cant find it! It will run index.js
* and watch files under folder src. Thanks. tell me if you found the source of this code
* I'm glad to mention it here.
*/
/* eslint-disable no-path-concat */
@mandaputtra
mandaputtra / .env.example
Last active July 3, 2019 14:31
A common .env for an app, cause I'm lazy
HOST=
PORT=
ENV=
REDIS_HOST=
REDIS_PORT=
DB_CLIENT=
DB_HOST=
DB_USER=
@mandaputtra
mandaputtra / README.md
Last active May 13, 2019 02:47
Javascript/Canvas - HTML5 articles links for image/video editing
@mandaputtra
mandaputtra / index.html
Last active May 13, 2019 02:06
Canvas invert color in image
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/style.css">
<title>A Gamma Image Editor</title>
</head>
<body>
@mandaputtra
mandaputtra / vscodeext.md
Last active January 28, 2019 09:49
my vscode extension

INSTALLING

code --install-extension <copy here and wait>

Copy this

ahmadawais.shades-of-purple

anseki.vscode-color
@mandaputtra
mandaputtra / js-shortcut.md
Created January 7, 2019 06:40
Simple JavaScript shortcut

Eliminating all duplicates in array with reduce() reduce take 4 params previousValue, currentValue, index, array

array.reduce((acc, el, i, arr) => {
    if (arr.indexOf(el) !== i && acc.indexOf(el) < 0) acc.push(el); return acc;
}, []);
@mandaputtra
mandaputtra / clickToSendWhatsapp.js
Created September 29, 2018 14:50
Click to send whastapp
// https://api.whatsapp.com/send?phone=+{{ *YOURNUMBER* }}&text=%20{{ *YOUR MESSAGE* }}
var yourNumber = "{{ your number in string}}"
var yourMessage = "{{ your message in string }}"
// %20 mean space in link
// If you already had an array then you just join them with '%20'
// easy right
function getLinkWhastapp(number, message) {
//
// the stack that i use with stylus-lang
//
#nib || stylus mixin
https://github.com/stylus/nib
#rupture || stylus media queries
https://github.com/jescalan/rupture