Skip to content

Instantly share code, notes, and snippets.

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

RiN r17x

🤘
REconciling...
View GitHub Profile
# ini membutuhkan direnv
# maka install juga direnv
# agar .envrc dapat dijalankan
# isi dari .envrc adalah
use nix
@r17x
r17x / alacritty.yaml
Created June 29, 2022 05:57
alacritty.yaml
window:
dimensions:
columns: 0
lines: 0
padding:
x: 0
y: 0
dynamic_padding: false
@r17x
r17x / .envrc
Last active June 19, 2022 17:47
per project flakes.
use flake
// we write Maybe module (stolen from haskell)
module Maybe = {
type t<'a> =
| Just('a)
| Nothing
let fmap = (x, fn) =>
switch x {
| Just(x) => Just(x->fn)
| Nothing => Nothing
@r17x
r17x / OSX.md
Created February 24, 2022 18:31
MacOS common tools

Common Tools for development in Mac

xcode-select

  • version
xcode-select --version
// xcode-select version 2392.
  • Install
@r17x
r17x / fpf.js
Created February 17, 2022 04:25
const add = (a, b) => a + b
const adds = (...n) => n.reduce(add)
const mul = (a, b) => a * b
const muls = (...n) => n.reduce(mul)
const div = (a, b) => a / b
const divs = (...n) => n.reduce(div)
const mod = (a, b) => a % b
/**
* @param {Number} n
* @return {Number}
* @example
*
* reverseNumber(123) // 321
* reverseNumber(212) // 212
* reverseNumber(123456789) // 987654321
*/
const reverseNumber = (input) => {
@r17x
r17x / .envrc
Created February 7, 2022 14:18
Nix-Shell w/ rust
use nix
@r17x
r17x / math.js
Created July 13, 2021 05:16
HeyTayoo.js
// HEY TAYO HEY TAYO DIA SI FUNGSI NAKAL MELAJU MENGHAJAR
// basic operation {a + b} {a - b} as function
let add = (a, b) => a + b;
let sub = (a, b) => a - b;
// function for add one {a + 1}
let addOne = (b) => add(1, b);
// function for reverse value by length that defined as {a}
// and solve with Math
let reverse = (a, b) => addOne(sub(a, b));
// function for know the maximum value of numbers
/**
* Example `FizzBuzz` with JavaScript (Pattern-Matching Like????????????) λ_(ツ)_/¯
* I Love this tweet
* @see https://twitter.com/cajuinaoverflow/status/1395022027204005889
* JavaScript will make You Crazy (Trust Me!)
*/
const FizzBuzz = n => ({
true: n,
[ n % 5 === 0]: "Buzz",
[ n % 3 === 0]: "Fizz",