Skip to content

Instantly share code, notes, and snippets.

View fawwaz's full-sized avatar
💻
Focusing

Fawwaz Muhammad fawwaz

💻
Focusing
View GitHub Profile
@fawwaz
fawwaz / readme.md
Last active April 26, 2024 13:55
How to create a dynamic nested object from array of properties

Background

Sometimes you want to describe how to access specific value in a nested object with an array of string consisiting a path to that specific object. So for example, if you have some js object like this :

const sampleObject = {
  a:{
    deep: {
      javascript: {
        object: 'I want this value'
      }
 }
@fawwaz
fawwaz / keybase.md
Created February 5, 2018 00:07
keybase proof

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@fawwaz
fawwaz / a-react-tutorial.md
Last active December 20, 2017 10:02
Simplified react tutorial

React tutorial

Please note that this is just a simple walkthrough how to use react.

What is react

A library for building user interfaces maintained by facebook.

Preparing the boilerplate

If you are too lazy to setup the environment, you can simply Play it directly here

index.html

@fawwaz
fawwaz / redux-tutorial.md
Last active November 22, 2017 09:15
simplified redux tutorial

Redux Tutorial

Please note that this is just a simple walkthrough how to use redux. You might not need to do some steps below because soya next automatically handle it. However, I am still explaining them just to give you a basic knowledge how to use redux.

What is Redux

Redux can be viewed as 'temporary/in Memory database' to store your variable. It can be accessed anywhere from react component as long as the component connected to redux.

Like many other 'database', there are 2 usage in redux

  1. Retrieving value
    It can be performed by using store.getState() (You won't call this function manually if using soya-next)
  2. Manipulating the value in 'database'
@fawwaz
fawwaz / es6-cheatsheet.markdown
Last active November 22, 2017 09:05 — forked from vasco3/es6-cheatsheet.markdown
Simplified ES6 cheatsheet

Intro

This cheatsheet is a simplified version of several cheatsheets around the internet. You can check other cheatsheet in the reference section on the bottom page.

Table of Contents generated with DocToc

@fawwaz
fawwaz / index.js
Created November 12, 2017 05:03
Timeout.js
"use strict";
var Timeout = function () {
var keyId = {};
var complete = {};
// set(key, func, ms) -- user-defined key
// set(func, ms) -- func used as key
//
// returns a function allowing you to test if it has executed
@fawwaz
fawwaz / README.md
Last active November 11, 2017 15:35
Modified Line Messenger NodeJS SDK

Modified Line Messenger NodeJS SDK

This code is modified version of Line Messenger NodeJS SDK. You can use it to test your bot locally for your side project. Please use it wisely, you should use the official SDK for more serious cases. For more serious cases, please follow the official guideline on how to test your bot locally here : line/line-bot-sdk-nodejs#32 This repo will not be maintained.

TLDR;

👍 You can test your bot locally, you can test directly on your own computer without passing through long-boring build pipeline, No need to put on staging server, Heroku / Azure or other PaaS provider just to test your bot is working. 🖥️

👍 Test your bot by simulating multiple user at once without any devices 📵

How to use it

@fawwaz
fawwaz / error
Last active May 25, 2016 01:36
Rekapitulasi data
java.io.NotSerializableException: java.lang.Object
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.HashMap.internalWriteEntries(HashMap.java:1777)
at java.util.HashMap.writeObject(HashMap.java:1354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
@fawwaz
fawwaz / Todolist
Last active April 18, 2016 11:29
dump data per 10 desember
Daftar oleh-oleh:
Saska & Labtek Indie 2 (kualitas)
Ayah & Ibu + keluarga => super 2 (kualitas) + kuantitas 1
anak-anak S2 (Rahma + Habibie + Alifa) 1 (kualitas)
TEC 2 (kuantitas)
Keselownatoran 1 (kuantitas)
Bu Masayu 1 (kualitas)
Nindy 1 (kualitas)
Cadangan (anak-anak lab) 2 (kuantitas)
@fawwaz
fawwaz / dumpdata per tanggal 10desember.json
Created December 10, 2015 05:26
DumpData Per tanggal 10 Desember
This file has been truncated, but you can view the full file.
{
"result": {
"metadata": {
"limit": 1000,
"offset": 0,
"count": 591,
"total": 591
},
"objects": [
{