Skip to content

Instantly share code, notes, and snippets.

@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,
@je-so
je-so / testprogram.c
Last active May 5, 2024 20:38
Xlib transparent window with OpenGL support
/*
____ _____
/\__ \ /\ ___\
\/__/\ \ \ \ \__/_
\ \ \ \ \____ \
_\_\ \ \/__/_\ \
/\ _____\ /\ _____\
\/______/ \/______/
Copyright (C) 2011 Joerg Seebohn
@linus
linus / Publish a message
Created January 4, 2012 15:54
Server-side Events with Node.js and Redis
linus@Newton:~$ redis-cli
redis 127.0.0.1:6379> publish /updates.foo "hello there!"
(integer) 1
redis 127.0.0.1:6379>
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@jewelsea
jewelsea / Clock.java
Created May 11, 2012 08:52
Sample of an animated clock in JavaFX
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.effect.Glow;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
@cboden
cboden / certificate.pem
Created August 19, 2012 16:03
No Async SSL w/ PHP
-----BEGIN CERTIFICATE-----
MIIEFzCCAv+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBqMQswCQYDVQQGEwJkZTEP
MA0GA1UECBMGSGVzc2VuMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBM
dGQxEzARBgNVBAcTCkRpbGxlbmJ1cmcxEjAQBgNVBAMTCTEyNy4wLjAuMTAeFw0x
MjA2MTYyMDE2MDhaFw0yMjA2MTQyMDE2MDhaMGoxCzAJBgNVBAYTAmRlMQ8wDQYD
VQQIEwZIZXNzZW4xITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDET
MBEGA1UEBxMKRGlsbGVuYnVyZzESMBAGA1UEAxMJMTI3LjAuMC4xMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAofA7J9eN5Q8pTrbHOBQC63gB4m6NPNjx
NZ302U5VK5SIkT8lYNk/uwY88C93jAgEBjgSk9IcLdzCRIay5UJmf92fSwZS+x+7
V8nQyuMtQ+9uipX5nhFVAj1iGbO92McsuBb9ck1jQuNt5YZW1WsnGivh88vMiKBa
@mkfmnn
mkfmnn / callback-bench.lua
Created September 15, 2012 06:45
Benchmark of LuaJIT FFI callbacks from C into Lua
local ffi = require("ffi")
ffi.cdef[[
typedef void (*cb)(void);
void call(int n, void (*)(void));
void loop(int n);
void func(void);
]]
local callback = ffi.load("./callback.so")
local timeit = require("timeit")
@rygorous
rygorous / gist:4172889
Created November 30, 2012 00:28
SSE/AVX matrix multiply
#include <immintrin.h>
#include <intrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
union Mat44 {
float m[4][4];
__m128 row[4];
};
@hintjens
hintjens / zcurve.c
Last active December 15, 2015 07:39
CurveZMQ prototype - see http://hintjens.com/blog:36 for the story.
/* =========================================================================
CurveZMQ - authentication and confidentiality for 0MQ
-------------------------------------------------------------------------
Copyright (c) 1991-2013 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at