Skip to content

Instantly share code, notes, and snippets.

arbabnazar /
Created Apr 23, 2019 — forked from zhiguangwang/
Configure websockets behind an AWS ELB.
simpixelated / start-non-split.js
Created Apr 23, 2019
Disable Code Splitting (and caching) In Create React App
View start-non-split.js
const rewire = require('rewire');
const defaults = rewire('react-scripts/scripts/start.js');
let configFactory = defaults.__get__('configFactory');
defaults.__set__('configFactory', (env) => {
const config = configFactory(env);
config.optimization.splitChunks = {
cacheGroups: {
default: false,
essidimed / PY0101EN-1-1-Types.ipynb
Created Apr 23, 2019
Created on Cognitive Class Labs
View PY0101EN-1-1-Types.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Araton95 / SwappableERC20.sol
Created Apr 23, 2019
Swappable ERC20 smart contracts NEW
View SwappableERC20.sol
pragma solidity 0.5.2;
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
library SafeMath {
* @dev Multiplies two unsigned integers, reverts on overflow.
View gist:830eb56a22ad8b33d6c61fb552193236
using System;
using System.Linq;
using NodaTime;
using NodaTime.Extensions;
public class Program
public static void Main()
var latest = (from zone in DateTimeZoneProviders.Tzdb.GetAllZones()
bhoriuchi / chef-databag-v3.js
Created Apr 23, 2019
nodejs Chef Databag V3 Encrypt/Decrypt
View chef-databag-v3.js
import crypto from 'crypto';
// decrypt a v3 databag
export function decryptV3(data, key) {
try {
const decipher = crypto.createDecipheriv(
NaveenaDraksharam / index.html
Created Apr 23, 2019
JS Bin rotated array find index // source
View index.html
<!DOCTYPE html>
<meta name="description" content="rotated array find index">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
arbabnazar /
Last active Apr 23, 2019 — forked from Likeyn/
How-to websockets through ELB + Nginx reverse proxy

Websockets-through-ELB-to-Nginx-to-another-ELB recap

We need to setup an ELB with SSL termination in front of a Nginx reverse proxy to some already working ELB + project system. IOW: SSL-ELB -> Nginx reverse proxy -> ELB -> project. We'll assume the last ELB + project bit works properly.

Front ELB configuration

  • Configure the listeners to use TCP (80) instead of HTTP to allow the websockets (non-HTTP) to pass through. For HTTPS with SSL termination, simply use SSL (443) -> TCP (80)
malex984 /
Created Apr 23, 2019
Sample module / application
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# encoding: utf-8
# coding: utf-8
Sample cli application
rust-play /
Created Apr 23, 2019
Code shared from the Rust Playground
fn main() {
let filter = "Joh";
let names = vec!["John", "Jane", "Johnny"];
let lowered_filter = filter.to_lowercase();
let filterNames = |x: &&str| -> bool {
let filtered: Vec<&str> = names.iter().cloned().filter(filterNames).collect();
println!("List {:?}", filtered);
You can’t perform that action at this time.