Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Parameters
socket="$1"
dump="/tmp/capture.pcap"
# Extract repetition
port=9876
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig"
{
init: function(elevators, floors) {
function optimizeDestinationQueue(elevator) {
queue = elevator.destinationQueue.sort();
console.log("starting queue: " + queue);
queue = queue.reduce(function (a, b) {
console.log("a: " + a);
if (a.indexOf(b) !== -1) {
return a;
}
@robo-corg
robo-corg / weather.15m.py
Last active January 6, 2016 18:51
forecast.io plugin for bitbar with fun emoji icons
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import forecastio
icon_to_emoji = {
'clear-day': u'☀️',
'clear-night': u'🌙',
'rain': u'🌧',
'snow': u'❄️',
@robo-corg
robo-corg / Color Square Isolation.ipynb
Created January 28, 2016 20:57
Solves the isolate the color witness puzzles
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
extern crate bytes;
extern crate futures;
extern crate tokio_io;
extern crate tokio_proto;
extern crate tokio_service;
use std::io::Result;
use std::error::Error;
use bytes::{BytesMut, BufMut};
use tokio_io::{AsyncRead, AsyncWrite};
@robo-corg
robo-corg / random game generator.ipynb
Created April 16, 2017 09:05
Random game generator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
# https://github.com/mitsuhiko/pipsi
BOOTSTRAP_DIR=~/.local/venvs/__bootstrap
BOOTSTRAP_PKGS=$(cat <<EOF
virtualenv
EOF
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.