Skip to content

Instantly share code, notes, and snippets.

@vwood
vwood / random_imgur.py
Created August 1, 2012 03:58
random imgur downloader
import os
import sys
import random
import time
import string
import Queue
import threading
from urllib2 import Request, urlopen, URLError, HTTPError
import hashlib
@vwood
vwood / channel.c
Created November 17, 2010 03:33 — forked from vwood/channel.c
Channels with asynchronous support.
#include <semaphore.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "channel.h"
struct channel_s {
sem_t empty_semaphore;
sem_t fill_semaphore;