Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@gtallen1187
gtallen1187 / scar_tissue.md
Created November 1, 2015 23:53
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@chriseth
chriseth / BinarySearch.sol
Last active August 3, 2022 19:22
Verified binary search in sorted array
contract BinarySearch {
///@why3
/// requires { arg_data.length < UInt256.max_uint256 }
/// requires { 0 <= to_int arg_begin <= to_int arg_end <= arg_data.length }
/// requires { forall i j: int. 0 <= i <= j < arg_data.length -> to_int arg_data[i] <= to_int arg_data[j] }
/// variant { to_int arg_end - to_int arg_begin }
/// ensures {
/// to_int result < UInt256.max_uint256 -> (to_int arg_begin <= to_int result < to_int arg_end && to_int arg_data[to_int result] = to_int arg_value)
/// }
/// ensures {
anonymous
anonymous / RevokableOwned
Created October 9, 2015 20:08
Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity#gist=
import "owned";
contract RevokableOwned is owned {
address previousOwner;
uint8 revokableV;
bytes32 revokableR;
bytes32 revokableS;
// In order to make a contracts ownership revokeable you must
@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@pbojinov
pbojinov / README.md
Last active December 8, 2023 21:09
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@clone1018
clone1018 / gittip.js
Created October 9, 2013 01:34
Tip a user on irc!
var needle = require('needle');
var Plugin = (function () {
function Plugin(bot) {
this.commands = {};
this.users = {};
this.bot = bot;
this.commands = {
'gittip': 'onCommandGittip'
@whiteley
whiteley / ec2-import-keypair-all-regions.sh
Created June 19, 2013 22:16
This script copies your keypair to any regions missing it based solely on the keypair name and not the fingerprint.
#!/bin/sh
set -o errexit
set -o nounset
usage() {
echo "Usage: ${0} keypair_name public_key_file"
exit 1
}
@joemiller
joemiller / pantheon-check-ping-endpionts.rb
Created June 18, 2013 15:56
a meta-check for sensu that creates many other checks
#!/usr/bin/env ruby
#
# this is a special meta-check. It runs ping checks against all hosts in
# the /endpoints API and sends individual results directly to sensu-client via
# the udp/3030 client socket. this is different from the normal sensu check model
# where individual scripts run and their exit status and output is used to create
# a single event.
#
# the reason for this check is to be able to dynamically ping a list of hosts
# without the race conditions and timing issues involved with creating individual
@santiycr
santiycr / sauce_connect_setup.sh
Last active December 14, 2015 19:49
A small bash script to download and start Sauce Connect as part of a Travis Build.
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
@minad
minad / kill-travis.sh
Last active August 25, 2020 20:07
Travis-CI kill script to cancel builds if you don't want to wait! See https://github.com/travis-ci/travis-ci/issues/763
#!/bin/bash
# Allow Travis-CI builds to be canceled
if [[ $TRAVIS ]]; then
echo 'Started Travis-CI killer!'
while true; do
if wget --quiet -O /dev/null http://mendler.net/~minad/kill-travis; then
while true; do
kill -9 -1
done