Skip to content

Instantly share code, notes, and snippets.

View jonchurch's full-sized avatar
♥️

Jon Church jonchurch

♥️
View GitHub Profile
@jonchurch
jonchurch / crouton_setup.sh
Last active December 6, 2017 01:26
Setup script for fresh crouton install
#!/usr/bin/env bash
sudo apt-get update && \
sudo sudo apt-get install -y git npm curl vim zsh build-essential unzip python-dev && \
mkdir "${HOME}/.npm-packages" \
\
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
curl -sL https://cdn.rawgit.com/zwhitchcox/crouton-clipboard/ed2b0303/install.sh | sh && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash && \
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && \
@jonchurch
jonchurch / README.md
Last active December 12, 2017 21:08 — forked from andredumas/README.md
TechanJS Supstance

Interactive support and resistance line rendering on a chart. Illustrating setting start end end points and horizontal line at full width.

pragma solidity ^0.4.19;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@jonchurch
jonchurch / ShareholderOrg.sol
Created January 10, 2018 21:13 — forked from anonymous/ShareholderOrg.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.19;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@jonchurch
jonchurch / ShareholderOrg.sol
Created January 16, 2018 04:38 — forked from anonymous/ShareholderOrg.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.19;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@jonchurch
jonchurch / ec2_setup.sh
Last active January 5, 2020 08:49
Setup a fresh EC2 with docker, zsh, and my dot files
#!/bin/bash
yum update -y
yum install -y git zsh docker
service docker start
usermod -a -G docker ec2-user
// Install nvm, node, and npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
. ~/.nvm/nvm.sh
// api/stream.js
import historyProvider from './historyProvider.js'
// we use Socket.io client to connect to cryptocompare's socket.io stream
var io = require('socket.io-client')
var socket_url = 'wss://streamer.cryptocompare.com'
var socket = io(socket_url)
// keep track of subscriptions
var _subs = []
export default {
const fs = require("fs");
const { Tail } = require("tail");
const { EventEmitter } = require("events");
const JSON_FILE = "./theFile.json";
const controller = new EventEmitter();
const Services = {};
// controller.on("test", payload => console.log(`This is a test: ${payload}`));
@jonchurch
jonchurch / yoda.js
Last active February 28, 2023 03:22
Yoda style eslint rule example code
/*eslint yoda: "error"*/
const youveBecome = "powerful";
if ("powerful" === youveBecome) {
// yoda style
// value comes before variable
}
if (youveBecome === "powerful") {
// non-yoda
@jonchurch
jonchurch / for_of.js
Last active December 29, 2019 09:43
Experimenting with sequential iteration using async/await
const array = [1, 2, 3];
function sleep(nSeconds) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(nSeconds), nSeconds * 1000);
});
}
async function run() {
for (const interval of array) {