Skip to content

Instantly share code, notes, and snippets.

View cem2ran's full-sized avatar
⚛️
~ The only constant is change ~

Cem Turan cem2ran

⚛️
~ The only constant is change ~
View GitHub Profile
@phated
phated / Emotion.re
Created October 5, 2018 22:48
Experimenting with a Reason API for Emotion
open BsReactNative;
[@bs.deriving abstract]
type style = {
[@bs.optional]
color: string,
[@bs.optional]
fontSize: float,
[@bs.optional]
margin: float,
@WhoAteDaCake
WhoAteDaCake / mail_client.re
Last active October 13, 2018 09:40
Sending mail using reasonml and ocamlnet
/* Has side-effects */
module Option = Core.Option;
let enable_debug_sf = () => Netsmtp.Debug.enable := true;
type mail_client = {
domain: string,
client: Netsmtp.client,
tls: (module Netsys_crypto_types.TLS_CONFIG),
};
@ejpcmac
ejpcmac / .envrc
Created September 28, 2018 20:55
.envrc for Phoenix projects using Nix and PostgreSQL
####################################
# Environment setup for Nix shells #
####################################
# From https://github.com/direnv/direnv/wiki/Nix#persistent-cached-shell
#
# Usage: use_nix [...]
#
# Load environment variables from `nix-shell`.
# If you have a `default.nix` or `shell.nix` one of these will be used and
@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

@OliverJAsh
OliverJAsh / README.md
Last active September 14, 2018 06:45
FP list combinators demo with fp-ts
tsc && node main.js
@keyboardsurfer
keyboardsurfer / installFromBundle
Last active August 8, 2020 15:33
Build & extract a set of apk from an aab for a specific device and install the results on it.
#!/bin/sh
# Build & extract a set of apk from an aab for a specific device and install the results on it.
#
# This needs https://github.com/google/bundletool to be available as `bundletool`.
# Also **exactly** one device needs to be connected to adb.
# Usage: installFromBundle bundle.aab
# optional `--extract-apks` to keep the set on your workstation as well.
basename=${1%%.*}
keystore="~/.android/debug.keystore"
@Zate
Zate / container.sh
Last active July 31, 2018 09:40
Writing a script out to automate containers in crostini
#!/bin/bash
run_container.sh --container_name test --user zate
sleep 3
lxc exec test -- sh -c "apt-get update && sleep 1 && apt-get upgrade -y && sleep 1 && apt-get install wget curl -y"
sleep 1
lxc exec test -- sudo -u zate bash -c 'cd ~ && pwd && curl https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/acbe81fe161ec194ab9eb30f1bf17f1f79919a45/get_go.sh -o get_go.sh && chmod +x get_go.sh && ./get_go.sh'
sleep 1
lxc exec test -- sudo -u zate bash -c 'cd ~ && pwd && curl https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/acbe81fe161ec194ab9eb30f1bf17f1f79919a45/get_vscode.sh -o get_vscode.sh && chmod +x get_vscode.sh && ./get_vscode.sh'
sleep 1
@Zate
Zate / gnome_chromote.sh
Created April 10, 2018 22:31 — forked from packetpilot/gnome_chromote.sh
headless ubuntu|debian + gnome, accessible via Chrome Remote Desktop
#!/bin/bash
# gnome and chrome and chrome remote desktop access
# chrome itself is not required, but is included here.
# other desktops can be used w/ light script changes.
# tested on:
# - ubuntu xenial GCE instance
# - debian stretch crostini container on a Pixelbook (eve)
# running ChromeOS v67.0.3383.0 (dev channel)
# _without_ being in developer mode