Skip to content

Instantly share code, notes, and snippets.

View coopermaruyama's full-sized avatar

Cooper Maruyama coopermaruyama

View GitHub Profile
@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
// 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 {
@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
});
});
@SachaG
SachaG / posts_list_controller.html
Last active March 2, 2016 23:26
Template Controller
<template name="postsListController">
{{> posts_list context}}
</template>
@SachaG
SachaG / gist:f22e04bf91751435806d
Created April 22, 2015 08:00
Telescope Package Hierarchy

Telescope has three tiers of packages.

Lib Packages

These are third-party packages such as Iron Router, SimpleSchema, AutoForm, etc. that are used throughout the app. Inside telescope:lib, they are used (api.use()) and then implied (api.imply()), which makes them available to any package that then uses telescope:lib.

Here's the full list:

  api.use([
.each(@list, @ruleset) {
@plugin "plugins/lambda";
@length : length(@list);
._iterate(1);
._iterate(@index) when (@index =< @length) {
@item : extract(@list, @index);
@lambda : lambda(@item, @index, item index, @ruleset);
@lambda();
@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 15, 2024 16:01
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active July 16, 2024 17:25
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis)
# Check our Studio: https://gentlenode.com/
meteor add iron:router
meteor update iron:router
# Iron Router > Configuration
@dillongreen
dillongreen / inf-apps.html
Last active January 2, 2016 04:19
using status/connection template helper from https://gist.github.com/8249758; note that the bootstrap-3 package is used here
<li id="nav-connection-status-li">
<span class="label {{connection_status.label}}">{{connection_status.connection_status}}</span> <span class="badge">{{connection_status.retryCount}}</span>
</li>