Skip to content

Instantly share code, notes, and snippets.

View mfbx9da4's full-sized avatar

David Alberto Adler mfbx9da4

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mfbx9da4 on github.
  • I am davidadler (https://keybase.io/davidadler) on keybase.
  • I have a public key whose fingerprint is AA68 4370 E7ED 4E46 0FA0 E454 6109 F697 337B FE6C

To claim this, I am signing this object:

type A = {
company_name: string
}
type B = {
person_name: string
}
enum CBURL {
GET_COMPANY = "/companies",
GET_PEOPLE = "/people"
}
@mfbx9da4
mfbx9da4 / FormikHooks.tsx
Last active May 11, 2019 22:23
A first draft of a re-implementation of Formik using react hooks specialised for react native
import React, {
useState,
SetStateAction,
createContext,
Dispatch,
ReactNode
} from 'react'
import { TextInput, TextInputProps } from 'react-native'
@mfbx9da4
mfbx9da4 / zoop.js
Last active December 26, 2019 09:22
console.log('hi')
function hide() {
Array.from(document.querySelectorAll('.listing-results-price')).map(x => x.style.display = 'none')
$('.ui-pricing').style.display = 'none'
$('.ui-layout__halves').style.display = 'none'
$('.dp-similar-wrapper').style.display = 'none'
setTimeout(hide, 200)
}
setTimeout(hide)
version: "3.3"
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: "DATABASE_NAME"
MYSQL_USER: "DB_USER"
MYSQL_PASSWORD: "DB_PASS"
MYSQL_ROOT_PASSWORD: "DB_PASS"
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker image rm $(docker images --filter "dangling=true" -q --no-trunc)
# docker image rm -f $(docker images -a -q)
docker volume rm $(docker volume ls -q)
docker network rm $(docker network ls -aq)
docker container ls -a
docker image ls -a
docker volume ls
function time(fn) {
var s = performance.now()
fn()
return performance.now() - s
}
function average(array) {
return array.reduce((prev, cur) => prev + cur, 0) / array.length
}
import { Component } from 'react'
class OverlayDesign extends Component {
state = {
hide: true,
}
listener = event => {
if (event.keyCode === 74) {
this.setState({ hide: !this.state.hide })
}
}
@mfbx9da4
mfbx9da4 / latency.txt
Created April 10, 2020 17:40 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
edges = [
{
node: {
description: null,
namespace: "arena",
valueType: "JSON_STRING",
value:
'["https://babywipeseco.myshopify.com/collections/nappies","https://babywipeseco.myshopify.com/collections/wipes","https://babywipeseco.myshopify.com/collections/"]',
id: "gid://shopify/Metafield/12637127966851",
key: "app_home__link",