Skip to content

Instantly share code, notes, and snippets.

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

RiN r17x

🤘
REconciling...
View GitHub Profile
@r17x
r17x / obs-youtube-chat.css
Created November 15, 2023 15:08
Live Chat Transparent
.style-scope yt-live-chat-renderer {
background-color: rgb(0, 0, 0, 0);
}
#items.yt-live-chat-item-list-renderer > *.yt-live-chat-item-list-renderer {
background-color: rgb(0, 0, 0, 0);
}
.yt-live-chat-text-message-renderer {
@r17x
r17x / p.js
Created October 30, 2023 12:33
Promise!01!
const _data = (data) => ({ error: null, data })
const _error = (error) => ({ data: null, error })
const mapError = f => ({ error, data }) => ({ error: f(error), data })
const mapData = f => ({ error, data }) => ({ data: f(data), error })
const promiseMapData = f => p => p.then(f)
const promiseMapError = f => p => p.catch(f)
const promiseMe = (p) => pipe(
@r17x
r17x / nginx_validation_jwt.lua
Created September 7, 2023 14:41
Nginx Validation JWT
access_by_lua_block {
local http = require "resty.http"
local httpc = http.new()
-- Fetch the JWT token from Authorization header
local auth_header = ngx.var.http_Authorization
if auth_header then
local _, jwt_token = auth_header:find("Bearer%s+(.+)")
if jwt_token then
-- Perform subrequest to your API endpoint for token validation
@r17x
r17x / a.md
Last active August 5, 2023 14:59
Hackerrank Functional Programming Challenge w/ OCaml
# 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