Skip to content

Instantly share code, notes, and snippets.

View jonchurch's full-sized avatar
♥️

Jon Church jonchurch

♥️
View GitHub Profile
@jonchurch
jonchurch / payload_example.js
Last active October 18, 2017 06:03
Button payload example for FBM
// Match the payload in the format of <category>:<userID>:<step>
// No way in heck a user would accidentally type this, and if a hacker figured out how to pull payloads out of my buttons or get at userID's,
// I'd have bigger issues to worry about. But ultimately, I'm checking everything serverside (this is part of a game, so the server has final word) so its hardly an issue
controller.hears('^planet:([a-zA-Z0-9.]{24}):cats', 'message_received', function(bot, message) {
var cats = {
attachment: {
type: 'template',
payload: {
template_type: 'generic',
@jonchurch
jonchurch / ShareholderOrg.sol
Created November 13, 2017 02:57 — 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.18+commit.9cf6e910.js&optimize=false&gist=
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@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.

@jonchurch
jonchurch / coin.sol
Last active December 23, 2017 10:47
Ethereum based coin contract from ethereum.com
pragma solidity ^0.4.8;
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract MyToken {
/* Public variables of the token */
string public standard = 'Token 0.1';
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
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
Last active June 2, 2018 13:05
Setup ec2
sudo yum update -y &&\
sudo yum install -y git zsh docker&&\
sudo service docker start &&\
sudo usermod -a -G docker ec2-user &&\
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh &&\
chsh -s $(which zsh) &&\
// 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 {