Skip to content

Instantly share code, notes, and snippets.

View laukaichung's full-sized avatar

watchdict laukaichung

View GitHub Profile
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.
@laukaichung
laukaichung / haproxy-ssl.cfg
Created May 29, 2017 09:26 — forked from christiannelson/haproxy-ssl.cfg
HAProxy Configurations
# References:
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
#
global
nbproc 2
maxconn 16384
defaults
@laukaichung
laukaichung / RNHtml
Last active September 13, 2017 04:42
Slate.js html serializer compatiable with react native
import * as React from 'react';
let immutable = require('immutable');
let StringRecord = new immutable.Record({
kind: 'string',
text: ''
});
let key = 0;
function addKey(element) {
return React.cloneElement(element, { key: key++ });
}
@laukaichung
laukaichung / Html.js
Last active September 13, 2017 09:12
import logger from 'slate-dev-logger'
import * as React from 'react'
import typeOf from 'type-of'
import { Node, State } from 'slate'
import RNHtml from "./RNHtml";
/**
* A rule to (de)serialize text nodes. This is automatically added to the HTML
* serializer so that users don't have to worry about text-level serialization.
*
@laukaichung
laukaichung / jwtRS256.sh
Created February 22, 2018 08:29 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@laukaichung
laukaichung / react-native-tab-view.d.ts
Created February 19, 2019 15:05
Updated Typescript definition for react-native-tab-view
// Type definitions for react-native-tab-view 1.0
// Project: https://github.com/react-native-community/react-native-tab-view
// Definitions by: Kalle Ott <https://github.com/kaoDev>
// Kyle Roach <https://github.com/iRoachie>
// Tim Wang <https://github.com/timwangdev>
// Gerardo Pacheco <https://github.com/geriux>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import {PureComponent, ReactNode, ComponentType, ReactComponentElement} from 'react'
import {
// Type definitions for react-native-modal-datetime-picker
// Project: https://github.com/mmazzarolo/react-native-modal-datetime-picker
// Definitions by: Kyle Roach <https://github.com/iRoachie>
// TypeScript Version: 2.3.2
import * as React from 'react'
import {StyleProp, TextStyle, ViewStyle} from 'react-native'
interface DateTimePickerProps {
/**
import rfdc from "rfdc";
import { CrudInterface, Database, OmitId, Table } from "brackets-manager";
import create from "zustand";
import { devtools, persist, StateStorage } from "zustand/middleware";
import {
Group,
Match,
MatchGame,
Participant,
Round,