Skip to content

Instantly share code, notes, and snippets.

// This example is adapted from the sample supplied with DynamicObject
// documentation on MSDN:
//
// http://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject.aspx
//
// The example has been adapted to be case-sensitive by default and
// test the dynamic object implementation across C#, IronPython 2.6.1 and
// IronRuby 1.0.
//
// The configuration needed to run this example is supplied at the bottom.
@teepark
teepark / btree.py
Created September 9, 2010 22:45
a pure-python B tree and B+ tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
@Mistat
Mistat / libevent2_sigint.c
Created December 11, 2010 12:59
libevent2 Catch SIGINT signal
/**
* libevent2 sample code
* Catch SIGINT signal
*/
#include <event2/event.h>
#include <stdio.h>
#include <stlib.h>
void sigint_event_function(evutil_socket_t fd, short what, void *arg)
{
@svick
svick / Program.cs
Created April 24, 2011 11:45
DynamicObject
using System;
using System.Dynamic;
namespace ConsoleApplication1
{
class Dynamic : DynamicObject
{
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
if (binder.Name == "Name")
@mtigas
mtigas / gist:952344
Last active September 30, 2025 09:22
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created November 18, 2011 15:18
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@rrichards
rrichards / gist:1423397
Created December 2, 2011 14:23 — forked from botchagalupe/gist:1080335
Setting up Chef-Solo

Images used in hack a thon

{ "name": "devops01", "id": "20095942", "uuid": "e55a9ac1e7f32b6228b53bea7f305621d6514bde", "public_ip": ['184.106.177.19'], "private_ip": ['10.180.128.208'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.0/544644/servers/20095942', 'imageId': '49', 'hostId': '4a98d4f222e5d8823fa87aada364b751', 'password': 'devops011aQwJ6M4h', 'metadata': {}}}

{ "name": "devops02", "id": "20095945", "uuid": "ae5355f4647f025e9506a53329734c4516a4098d", "public_ip": ['184.106.177.24'], "private_ip": ['10.180.128.207'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.0/544644/servers/20095945', 'imageId': '49', 'hostId': '5c916b5d52edc2f3f39feed720188d73', 'password': 'devops02U6HtQn26p', 'metadata': {}}}

{ "name": "devops03", "id": "20095947", "uuid": "8abd4227ecb5792072a271092b25f2049937e3bc", "public_ip": ['184.106.177.25'], "private_ip": ['10.180.128.206'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.

@noonat
noonat / gist:1649543
Created January 20, 2012 21:02
Rake Quick Reference
# Rake Quick Reference
# by Greg Houston
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html
# -----------------------------------------------------------------------------
# Running Rake
# -----------------------------------------------------------------------------
# running rake from the command-line:
# rake --help
@moraes
moraes / gist:2141121
Last active September 28, 2025 09:56
LIFO Stack and FIFO Queue in golang
package main
import (
"fmt"
)
type Node struct {
Value int
}
@btoone
btoone / curl.md
Last active December 10, 2025 22:00
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin