Skip to content

Instantly share code, notes, and snippets.

@capotej
capotej / speeches.rb
Created December 18, 2013 02:19
presidential speech markov model
require 'open-uri'
require 'nokogiri'
require 'marky_markov'
markov = MarkyMarkov::Dictionary.new('dictionary')
page = Nokogiri::HTML(open("http://millercenter.org/president/speeches"))
speech_urls = []
Lol Working Group J.
Internet-Draft LMAO, Inc.
Expires: August 05, 1989 February 1989
Derping the Herp
Abstract
This memo presents a technique for derping the herp as a source
@capotej
capotej / gist:6135693
Created August 1, 2013 21:51
Cool KSP mods I like to use
http://kerbalspaceport.com/chatterer/
http://kerbalspaceport.com/bolt-on-screenshot-system-boss/
http://kerbalspaceport.com/0-18-4-zeus-space-telescope/
http://kerbalspaceport.com/protractor-for-ksp-0-18/
http://kerbalspaceport.com/lazor-docking-cam/
http://kerbalspaceport.com/isa-mapsat-3-3-4-unofficial-update/
@capotej
capotej / testcache.go
Created July 28, 2013 00:53
Single node, nonnetwork example of groupcache
package main
import (
"fmt"
"github.com/golang/groupcache"
)
type SlowDB struct {
data map[string]string
}
→ curl -X POST -A "Content-Type: application/x-www-form-urlencoded" -X POST -d "name=get&keys=QB1eK3lo_g" http://api.rdio.com/1/
<h1>403 Developer Inactive</h1>%
rebuild () {
zinc -nailed -start
cd $BIRDCAGE_HOME && mvn clean -Pzinc -pl $1 -am install -DskipTests
cd $BIRDCAGE_HOME/$1
}
@capotej
capotej / App.scala
Created April 25, 2013 18:58
dead simple http proxy in finagle
package com.twitter.dumproxy
import com.twitter.finagle.Service
import org.jboss.netty.handler.codec.http._
import java.net.InetSocketAddress
import com.twitter.finagle.builder.{ClientBuilder, Server, ServerBuilder}
import com.twitter.finagle.http.Http
object App {
package com.twitter.loadreceiver
import io.netty.bootstrap.ServerBootstrap
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.nio.NioServerSocketChannel
import io.netty.channel.ChannelInitializer
import io.netty.channel.socket.SocketChannel
import io.netty.handler.codec.http.HttpObjectAggregator
import io.netty.handler.codec.http.HttpRequestDecoder
import io.netty.handler.codec.http.HttpResponseEncoder
@capotej
capotej / fabfile.py
Created February 27, 2013 19:08
chef-solo deployer/bootstrapper
from fabric.api import *
from fabric.contrib.files import exists
from fabric.contrib.project import upload_project
## Usage
# Full run, bootstraps if needed
# fab chef:name_of_runlist,hosts=1.1.1.1 --password=1234 --user=foo
# fab chef:name_of_runlist,hosts=1.1.1.1 -i=path/to/pem --user=foo
Error executing action `run` on resource 'execute[build debian package]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '3'
---- Begin output of dpkg-buildpackage -us -uc ----
STDOUT: dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value: