Skip to content

Instantly share code, notes, and snippets.

View coopermaruyama's full-sized avatar

Cooper Maruyama coopermaruyama

View GitHub Profile
@SachaG
SachaG / posts_list_controller.html
Last active March 2, 2016 23:26
Template Controller
<template name="postsListController">
{{> posts_list context}}
</template>
@markerikson
markerikson / redux-socket-middleware-example.js
Created June 28, 2018 00:37
Redux socket middleware example usage
const createMySocketMiddleware = (url) => {
return storeAPI => {
let socket = createMyWebsocket(url);
socket.on("message", (message) => {
storeAPI.dispatch({
type : "SOCKET_MESSAGE_RECEIVED",
payload : message
});
});
// Note that this is not the production code
pragma solidity 0.5.6;
import "./IERC20.sol";
contract Wallet {
address internal token = 0x123...<hot_wallet_addr>;
address internal hotWallet = 0x321...<hot_wallet_addr>;
constructor() public {
@coopermaruyama
coopermaruyama / geth-nginx-healthcheck.md
Last active January 16, 2024 02:51
Go-Ethereum (Geth) NGINX Health Check (Ubuntu)

Uses NGINX's njs module to query geth's eth_syncing RPC endpoint. Considered as "healthy" only when the syncing attribute is false.

This is useful if you are managing a cluster of geth nodes behind a load balancer and need a compatible healthcheck.

  1. Create a directory to store our njs script