Skip to content

Instantly share code, notes, and snippets.


Vadim Dalecky streamich

  • http://localhost:8080
Block or report user

Report or block streamich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile



streamich / lambda.js
Last active Jul 16, 2019 — forked from maxbeatty/lambda.js
using node-postgres (`pg`) in AWS Lambda
View lambda.js
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000

Specify required fields, rest will be optional.

export type Required<T, K extends keyof T> = Partial<T> & Pick<T, K>;

Specify which fields to omit.

export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
streamich / gist:03d109062e4b330359dd6e11481fbd6f
Created Aug 31, 2018 — forked from kingbin/gist:9435292
Manually Start/Stop PostgresSQL on Mac
View gist:03d109062e4b330359dd6e11481fbd6f
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start


Smallest possible CSS-in-JS library.


PubSub class like this:

class PubSub {
  constructor () {
    this.el = document.createElement('div');

  subscribe (eventName, handler) {
    this.el.addEventListener(eventName, handler);
streamich /
Last active Mar 5, 2018
Usage cases for async generator render functions:

Load data on client and server:

async function * MyComponent() {
  yield (<div>Loading...</div>);
  const users = await fetch('/users');
  yield () =>
      <UserList users={users} />
      <button onClick={this.props.onClick}>{this.props.buttonLabel}</button>
View 1-future-ideas.js
const React = require("react");
const Lifecycles = React.createLifecycleEvents({
didMount({ setState }) {
disabled: false,
didUpdate({ inputRef }) {
if (document.activeElement !== inputRef.value) {
View index.html
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>For loop benchmark</title>
<script src=""></script>
<script src="./suite.js"></script>
<h1>Open the console to view the results</h1>
streamich / react16-css.js
Created Oct 7, 2017
Dynamic CSS for React components using React's v16 element array render result
View react16-css.js
class Button extends Component {
background-color: #ff0000;
width: 320px;
padding: 20px;
border-radius: 5px;
border: none;
outline: none;
&:hover {
You can’t perform that action at this time.