Skip to content

Instantly share code, notes, and snippets.

View csquared's full-sized avatar

Chris Continanza csquared

  • GRAX (ex-stripe, ex-coinbase, ex-heroku)
  • Austin, TX
View GitHub Profile
@csquared
csquared / StatusMonitor.ino
Last active April 29, 2019 12:59
Heroku Status Lights Monitor - Arduino Software
/*
Heroku Office Status Monitor
What it is: Arduino + Ethernet Shield
What it does: Networked device that provides status monitoring.
Components:
- Status site monitor
HTTP GET to http://outage-lights.herokuapp.com/status to consume current Heroku Platform status.
@csquared
csquared / push_pull_broker.c
Created June 10, 2013 17:28
Push-Pull ZMQ Broker to act as a proxy/intermediary between multiple PUSH and PULL sockets.
#include <stdio.h>
#include "zhelpers.h"
int main(void)
{
void *context = zmq_ctx_new();
void *reciever = zmq_socket(context, ZMQ_PULL);
zmq_bind(reciever, "tcp://127.0.0.1:5557");
puts("reciever on tcp://127.0.0.1:5557");
var logfmt = require('./logfmt');
myTimelyFunction = function(done) {
logfmt.log({ "foo": "bar", "a": 14, baz: 'hello kitty'})
done('timely_function');
}
logfmt.time(myTimelyFunction);
var logfmt = require('./logfmt');
myTimelyFunction = function() {
logfmt.log({ "foo": "bar", "a": 14, baz: 'hello kitty'})
}
logfmt.time(function(done){
myTimelyFunction();
done('timely_function');
});
exports.logger = logfmt.requestLogger(
elapsed: "measure#http.#{req.method.toLowerCase()}",
(req, res) ->
ns: "app-state"
source: req.url
status: res.statusCode
from: req.socket && (req.socket.remoteAddress || (req.socket.socket && req.socket.socket.remoteAddress))
"agent": req.headers["user-agent"]
"request_id": req.headers["x-request-id"]
var split = require('split');
var logfmt = require('logfmt');
var through = require('through');
var _ = require('underscore');
var list = []
var parseLine = function(line){
if(/INFO/.test(line)) return;
#set-option -g default-terminal "screen-256color"
# command prefix (like screen)
set -g prefix C-a
bind C-a send-prefix
#bind tab select-pane -t :.+
# quit \
unbind \

Internet of Things

Things

  • shrinking size
  • increasing power

Things

  • MicroProcessor (Tiny)
@csquared
csquared / talk.md
Last active December 30, 2015 12:18

Internet of Things

github.com/csquared

@em_csquared

Things == Computers

  • shrinking size
-- don't rollback the entire fucking transaction
-- if you typo a sql command, but only in interactive mode
\set ON_ERROR_ROLLBACK interactive
-- a prompt wtih transaction information
\set PROMPT1 '%[%033[33;1m%]%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%]%R%# '
-- automatically switch between extended and normal
-- depending on how wide the output is
\x auto