Skip to content

Instantly share code, notes, and snippets.

View r17x's full-sized avatar
🤘
REconciling...

RiN r17x

🤘
REconciling...
View GitHub Profile
@r17x
r17x / Payment.re
Created May 1, 2021 10:15
Payment Case with FP
type checkNumber = int;
type cardNumber = string;
type cardType =
| Visa
| Mastercard;
type creditCardInfo = (cardNumber, cardType);
@r17x
r17x / index.js
Created April 26, 2021 15:34
Measure my Browser callstack
export const getMaxCallStack = () => {
let i=0;
function rec(){
i++; rec();
}
try {rec();} catch(e){}finally{return i}
}
@r17x
r17x / remove-console-log.js
Created April 20, 2021 05:50
[Metaprogramming] Basic with javscript - Remove Console.log code
// remove-consoles.js
// run with command jscodeshift -t remove-consoles.js src/**/*.js
export default (fileInfo, api) => {
const j = api.jscodeshift;
return j(fileInfo.source)
.find(j.CallExpression, {
callee: {
type: 'MemberExpression',
object: { type: 'Identifier', name: 'console' },
@r17x
r17x / array.js
Created April 8, 2021 08:01
I dunno what i'm doing but i know it's just help people
// ISSUE https://www.facebook.com/permalink.php?story_fbid=2923264041231670&id=100006443087773
// we have some data with item is
// { id: number, name: string, jumlahDonasi: number }
const data = [
{
id: 1,
name: "c",
jumlahDonasi: 2000,
},
{
@r17x
r17x / gql-fetch.js
Created March 17, 2021 04:57
Raw Graphql Query in Browser (Pure Javascript)
// UNCOMMENT when run in node
// let fetch = require("node-fetch");
let GQL_URI = "https://api.graphql.jobs/";
let query = `query{
jobs{
title
description
company{
name
title description author
<!-- anti anti click bait -->
<!-- write with humanity -->
<!-- whoami/team/squad/personal -->

Background

Goal

@r17x
r17x / System Design.md
Created October 19, 2020 18:39 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@r17x
r17x / example.re
Created October 19, 2020 18:22
DSL
// @broerjuang https://discordapp.com/channels/735469928378925156/736199426309226536/767813964285214812
// parser -> Parser Generator || Parser Combinator
open ReludeParse.Parser;
let input = "
filterBy Category = \"'fantasy'\"
orderBy Rating desc
skip 5
take 10
";
@r17x
r17x / emulator-install-using-avdmanager.md
Created September 28, 2020 09:39 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

🗣 Commented on #1 in antonybudianto/next-code-antonybudianto
🗣 Commented on #1 in ri7nz/rescript-chakra
💪 Opened PR #1 in ri7nz/rescript-chakra
🎉 Merged PR #8 in evilfactorylabs/learning-resources
🗣 Commented on #8 in evilfactorylabs/learning-resources