Skip to content

Instantly share code, notes, and snippets.

View darcien's full-sized avatar
🚴

Yosua Ian Sebastian darcien

🚴
View GitHub Profile
@darcien
darcien / index.css
Created March 28, 2024 17:32
Indeterminate progress indicator a la Windows XP boot
.bar {
background-color: white;
width: 200px;
padding: 4px;
border-radius: 4px;
border: 2px solid;
overflow: hidden;
height: 20px;
}
@darcien
darcien / justfile
Created June 25, 2023 15:09
justfile for restic backup, put this in home dir
set dotenv-load
export RESTIC_REPOSITORY := 'E:\restic-repo'
# This retrieve the pw from bitwarden vault.
# bw cli needs bw login and bw session key set in .env before used.
export RESTIC_PASSWORD := `bw get password "restic repo"`
# Restic docs
# https://restic.readthedocs.io/en/stable/index.html
@darcien
darcien / visualizePr.ts
Last active May 31, 2023 16:39
script to visualize recent pr line diff counts for internal jokes
#!/usr/bin/env -S deno run
import { sortBy } from "https://deno.land/std@0.186.0/collections/sort_by.ts";
import { groupBy } from "https://deno.land/std@0.186.0/collections/group_by.ts";
import { reduceGroups } from "https://deno.land/std@0.186.0/collections/reduce_groups.ts";
import { plot } from "https://deno.land/x/chart@1.1/mod.ts";
// Using JSON from this gh --json output
// gh pr list --json title,additions,deletions,changedFiles,author,number --search "uiv2 in:title" --state=all --limit 300
type Pr = {
@darcien
darcien / binary.ts
Created February 18, 2020 08:33
Median of Two Sorted Arrays
function medianOfTwoSorted(sortedA: Array<number>, sortedB: Array<number>) {
let [m, n] = [sortedA.length, sortedB.length];
if (m > n) {
// Use the longest array for m.
[sortedA, sortedB, m, n] = [sortedB, sortedA, n, m];
}
if (n === 0) {
throw new Error('Array should not be empty');
@darcien
darcien / install_nodejs_and_yarn_homebrew.md
Created September 20, 2019 04:04 — forked from nijicha/install_nodejs_and_yarn_homebrew.md
Install NVM, Node.js, Yarn via Homebrew

Install NVM, NodeJS, Yarn via Homebrew

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Part A: Install NVM and NodeJS

  1. Install nvm via Homebrew
@darcien
darcien / package.json
Created January 17, 2019 07:43
Jest configuration for RN with expo
{
"jest": {
"preset": "jest-expo",
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"testMatch": [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)+(spec|test).ts?(x)"
@darcien
darcien / tslint.json
Last active January 17, 2019 04:53
TSLint config for RN
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-plugin-prettier",
"tslint-config-prettier",
"tslint-config-kodefox"
],
"linterOptions": {
@darcien
darcien / tsconfig.json
Last active June 7, 2019 15:52
Updated for Expo SDK 34
{
"extends": "./node_modules/tsconfig-kodefox/tsconfig",
"compilerOptions": {
"noEmit": true,
"lib": ["dom", "esnext"],
"jsx": "react-native",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"typeRoots": ["node_modules/@types", "custom_types"]
@darcien
darcien / settings.json
Last active November 12, 2019 07:42
vscode settings
{
"workbench.startupEditor": "newUntitledFile",
"editor.multiCursorModifier": "alt",
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.bracketSpacing": false,
"prettier.arrowParens": "always",
"workbench.colorTheme": "SynthWave '84",
"editor.scrollBeyondLastLine": false,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>getUniqueList</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>