I hereby claim:
- I am itsjonq on github.
- I am itsjonq (https://keybase.io/itsjonq) on keybase.
- I have a public key ASB0svRnRcuz0nmoHAUZQVPC1C7WDkUmBjSnZDbWJDF_rwo
To claim this, I am signing this object:
import { useState, useEffect, useRef } from "react"; | |
export function useControlledState(initialState) { | |
const [state, setState] = useState(initialState); | |
const stateRef = useRef(initialState); | |
useEffect(() => { | |
if (initialState !== stateRef.current) { | |
setState(initialState); | |
stateRef.current = initialState; |
I hereby claim:
To claim this, I am signing this object:
// Source | |
// https://github.com/facebook/react/blob/master/fixtures/unstable-async/time-slicing/src/Clock.js | |
import React, {createRef, PureComponent} from 'react'; | |
const SPEED = 0.003 / Math.PI; | |
const FRAMES = 10; | |
export default class Clock extends PureComponent { | |
faceRef = createRef(); |
export function createUniqueIDFactory(prefix) { | |
let index = 1 | |
return `${prefix}${index++}` | |
} |
/** | |
* Retrieves a (deeply) nested value from an object. | |
* A tiny implementation of lodash.get. | |
* | |
* Tests: | |
* https://codesandbox.io/s/48052km1q7 | |
* | |
* Perf tests: | |
* https://jsperf.com/get-try-catch-vs-reduce-vs-lodash-get | |
* |
sudo apt-get update | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' | |
sudo apt-get install -y vim curl python-software-properties | |
sudo add-apt-repository -y ppa:ondrej/php5 | |
sudo apt-get update | |
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.network :private_network, ip: "192.168.33.21" |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
<!doctype html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="public/css/main.css"> |