Skip to content

Instantly share code, notes, and snippets.

View darcien's full-sized avatar
🚴

Yosua Ian Sebastian darcien

🚴
View GitHub Profile

Keybase proof

I hereby claim:

  • I am darcien on github.
  • I am yosua (https://keybase.io/yosua) on keybase.
  • I have a public key whose fingerprint is 001C 856C 6BCE 8DB1 2D03 6F9D 389E 6CA1 BA6C 4826

To claim this, I am signing this object:

@darcien
darcien / .zshrc
Last active October 27, 2018 09:27
zsh config, to be used with oh-my-zsh and bullet-train theme
PATH="/usr/local/bin:$(getconf PATH)"
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Path for yarn.
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
@darcien
darcien / bullet-train.zsh-theme
Last active October 27, 2018 10:11
Custom version of bullet-train theme
# README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
# In addition, I recommend the
# [Tomorrow Night theme](https://github.com/chriskempson/tomorrow-theme) and, if
# you're using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over
# Terminal.app - it has significantly better color fidelity.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Math clamp</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>
<!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>
@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,
@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 / 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 / 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 / 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');