Skip to content

Instantly share code, notes, and snippets.

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

RiN r17x

🤘
REconciling...
View GitHub Profile
module AsyncResult = Relude.AsyncResult;
module Effect = ReludeReact.Effect;
module IO = Relude.IO;
module Option = Relude.Option;
module Reducer = ReludeReact.Reducer;
let (toBusy, completeOk, completeError) =
AsyncResult.(toBusy, completeOk, completeError);
type state('a, 'e) = AsyncResult.t('a, 'e);
open Belt;
[@bs.deriving abstract]
type queryConfig('data, 'key, 'fnParamsFilter) = {
[@bs.optional]
retry: int,
[@bs.optional]
retryDelay: int,
[@bs.optional]
initialData: unit => 'data,
@danbst
danbst / home-etc.nix
Created December 27, 2019 15:17
Manage your /etc from home-manager (install home-manager as root)
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
];
options.system.build.etc = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {
@mlms13
mlms13 / Api.re
Created December 21, 2019 05:08
Request Weather Data using Relude
open Relude.Globals;
let baseUrl = "http://localhost:5050";
// `getForecast` is an IO that will either succeed with decoded
// ForecastData or fail with a Fetch error.
//
// Since IO is inherently lazy, creating this value doesn't actually
// _do_ anything. Instead it needs to be run, which we do inside an
// `UpdateWithIO` return from a `useReducer` branch in our view.
-- We want to prove this:
fmap (compose g f) == compose (fmap g) (fmap f)
-- Fact:
fmap :: (b -> c) -> (a -> b) -> (a -> c)
compose :: (b -> c) -> (a -> b) -> (a -> c)
-- Prove
fmap id f
(\ h g x -> h (g x)) id f
@artyorsh
artyorsh / README.md
Last active June 21, 2023 16:36
Metro and Babel monorepo resolver functions

React Native Metro and Babel resolver functions for monorepo projects

Have you ever faced troubles when configuring a fresh react-native app to test your framework locally? These utility functions will help you to configure metro and babel to run your monorepo-structured framework and test it's modules without a need to publish them.

Simply copy and paste the files below into your project root and follow the guides explained in both of them.

See an Example project

@wayanjimmy
wayanjimmy / cli-apps-dev.md
Last active February 4, 2024 11:23
I curate a list of interesting CLI tools, below are some command line tools that I personally love and use

I curate a list of interesting CLI tools, below are some command line tools that I personally love and use

  • tmux - Terminal multiplexer.
  • ripgrep - Search text for patterns fast.
  • fzf - Command-line fuzzy finder.
  • exa - Replacement for ls written in rust.
  • git - Version control.
  • create-react-app - Create React apps with no build configuration.
  • npx - Execute npm package binaries.
  • wifi-password - Get the password of the WiFi you're on.
@Buom01
Buom01 / ic_logo.xml
Last active December 23, 2019 18:03
TWA splashscreen
<!---
IMPORTANT NOTE: This gist in now useless since splashscreen are now supported: https://github.com/GoogleChromeLabs/svgomg-twa/pull/23/files#diff-4ad2826e1292d083a4995de57bfaf133
-->
<!-- import here your svg logo (in drawables)
See https://stackoverflow.com/questions/30923205/easiest-way-to-use-svg-in-android/39266840#39266840
-->
import React, { useState } from 'react';
const ProductCategoryRow = (props) => {
const category = props.category;
return (
<tr>
<th colSpan="2">
{category}
</th>
</tr>
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 28, 2024 20:30
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

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

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"