Skip to content

Instantly share code, notes, and snippets.


Ade Yahya Prasetyo adeyahya

Block or report user

Report or block adeyahya

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
adeyahya / csvutils.js
Created Jan 14, 2018
CSV Utils using Ramda
View csvutils.js
const R = require('ramda');
const csvToArray = csvText =>
.map(item => item.split(','))
// new line will produce Array with length 1 & with value ''
// ignore it
.filter(item => item[0] !== '');
View scrollDirection.js
(function() {
let lastScrollTop = 0;
let scrollUpEvent = new Event("scrollUp");
let scrollDownEvent = new Event("scrollDown");
document.addEventListener("scroll", function(){ // or window.addEventListener("scroll"....
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > lastScrollTop){
} else {
adeyahya /
Created Oct 19, 2017
Change all commit author name or Email

Change all commit author name or Email


git filter-branch --env-filter '
CORRECT_NAME="Your Correct Name"
View currying.js
const curry = require('lodash/curry')
const match = curry(function(what, str) {
return str.match(what)
const replace = curry(function(what, replacement, str) {
return str.replace(what, replacement)
View dynamic-import.js
if ( 'IntersectionObserver' in window ) {
const observer = new IntersectionObserver(callback, options)
} else {
import(/* webpackChunkName: "intersection-observer" */ 'intersection-observer').then(_ => {
const observer = new IntersectionObserver(callback, options)
adeyahya /
Created Jan 19, 2017 — forked from jonathantneal/
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
adeyahya / reg_replace.sublime-setting
Created Sep 22, 2016
Replace class with className when using jsx syntax in sublime text
View reg_replace.sublime-setting
"replacements": {
"js_class": {
"find": " class=\"",
"replace": " className=\"",
"greedy": true,
"case": false
adeyahya / Default (OSX).sublime-keymap
Created Sep 22, 2016
Sublime Text keymap to invoke emmet inside jsx
View Default (OSX).sublime-keymap
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
You can’t perform that action at this time.