Skip to content

Instantly share code, notes, and snippets.

View compleatang's full-sized avatar

Casey Kuhlman compleatang

View GitHub Profile
@compleatang
compleatang / index.html
Last active August 29, 2015 14:00
SegFault on html Import
<!DOCTYPE html>
<html>
<head>
<title>EPM</title>
<meta charset='utf-8'>
<meta content='Front End for Ethereum Package Manager' name='description'>
<meta content='Casey Kuhlman' name='author'>
<link href='http://localhost:9090/assets/styles/application' rel='stylesheet'>
</head>
<body>
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
self.sendTransaction = function() {
account = self.myPublicKeyStrings.indexOf(self.sendingPublic());
secret = key.secret(eth.keys()[account]);
$.ajax('/transactions/compile_text_data', {
data: self.transactionData(),
type: 'post',
contentType: 'application/text',
success: function(result) {
self.compiledTransactionData(result);
console.log(self.compiledTransactionData());
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'koala' # gem install koala --no-document
# create a facebook app and get access token from here
# https://developers.facebook.com/tools/explorer
# select "user_status", "friends_status", "user_checkins" when authenticating
oauth_access_token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
graph = Koala::Facebook::API.new(oauth_access_token)
places = []
@compleatang
compleatang / lazy-pirate-client.go
Created April 13, 2014 12:56
ZMQ Lazy Pirate Pattern in Go
// Lazy Pirate client
// Use zmq_poll to do a safe request-reply
// To run, start lpserver and then randomly kill/restart it
//
// Author: iano <scaly.iano@gmail.com>
// Based on C example
package main
import (
@compleatang
compleatang / lazy-pirate-client.cpp
Created April 13, 2014 12:52
ZMQ Lazy Pirate Pattern in C++
//
// Lazy Pirate client
// Use zmq_poll to do a safe request-reply
// To run, start piserver and then randomly kill/restart it
//
#include "zhelpers.hpp"
#include <sstream>
#define REQUEST_TIMEOUT 2500 // msecs, (> 1000!)
@compleatang
compleatang / lazy-pirate-client.rb
Last active August 29, 2015 13:59
ZMQ Lazy Pirate Pattern in Ruby
#!/usr/bin/env ruby
# Author: Han Holl <han.holl@pobox.com>
require 'rubygems'
require 'ffi-rzmq'
class LPClient
def initialize(connect, retries = nil, timeout = nil)
@connect = connect
# A demonstration of the CurveCP handshake protocol. This protocol has many
# favorable security properties described at http://curvecp.org.
#
# In addition to its security advantages, it has the following favorable properties:
# * Needs only 2 messages (1 from client, 1 from server) before application
# messages can be exchanged (3 before the server can send application messages)
# * Does not require the server to keep protocol state between handshake messages.
#
# An overview of the protocol:
#
@compleatang
compleatang / .htaccess
Created April 9, 2014 21:06
Gandi PAAS SSL Redirect
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
@compleatang
compleatang / extractannotations.py
Created January 28, 2014 12:08
Extract Annotations from a PDF File.
#!/usr/bin/env python
import poppler
import sys
import urllib
import os
def main():
input_filename = sys.argv[1]
# http://blog.hartwork.org/?p=612