Skip to content

Instantly share code, notes, and snippets.

import cv2
import cv2.cv as cv
def detect(img, cascade_fn='haarcascades/haarcascade_frontalface_alt.xml',
scaleFactor=1.3, minNeighbors=4, minSize=(20, 20),
flags=cv.CV_HAAR_SCALE_IMAGE):
cascade = cv2.CascadeClassifier(cascade_fn)
rects = cascade.detectMultiScale(img, scaleFactor=scaleFactor,
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>

This gist is the source code for http://gary.beagledreams.com/page/go-websocket-chat.html

Copyright (c) 2013 Gary Burd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

This gist is the source code for http://gary.beagledreams.com/page/go-websocket-chat.html

Copyright (c) 2013 Gary Burd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@hfeeki
hfeeki / gist:9046390
Created February 17, 2014 07:41
How to execute external command in scons like make file
document.pdf: table.tex
pdflatex document.tex
table.tex:
python table_generator.py
Something along these lines should do -
```
env.Command ('document.tex', '', 'python table_generator.py')
//Decodes Base64
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <string.h>
#include <stdio.h>
int calcDecodeLength(const char* b64input) { //Calculates the length of a decoded base64 string
int len = strlen(b64input);
int padding = 0;
-spec get_timestamp() -> integer().
get_timestamp() ->
{Mega, Sec, Micro} = os:timestamp(),
(Mega*1000000 + Sec)*1000 + round(Micro/1000).
@hfeeki
hfeeki / pr_ring.erl
Created February 26, 2014 05:24 — forked from aerosol/pr_ring.erl
-module(pr_ring).
-compile(export_all).
start(M, N, Message) ->
io:format("Starting ~p processes and sending ~p ~p~n", [N,M,Message]),
ProcessList = spawn_ring(M, N, []),
io:format("Spawned ~p~n", [ProcessList]),
hd(ProcessList) ! { Message, ProcessList }.
@hfeeki
hfeeki / ring.erl
Created February 26, 2014 05:29 — forked from pperon/ring.erl
-module(ring).
-export([start/3, loop/0]).
%%%
%%% An implementation of an Erlang process ring. This is probably the
%%% Erlang equivalent of breaking your first board in Karate class.
%%%
start(NumMsgs, NumProcs, Msg) ->
UnlinkedRing = create_process([], NumProcs),