Skip to content

Instantly share code, notes, and snippets.

@bitbegin
bitbegin / defl.c
Created November 17, 2019 07:10 — forked from vurtun/defl.c
Full deflate/inflate implementation in ~250 LoC
/* ===============================================================
* SDEFL
* ===============================================================
* public domain - no warranty implied; use at your own risk
* References:
https://bitbucket.org/rmitton/tigr/src/be3832bee7fb2f274fe5823e38f8ec7fa94e0ce9/src/tigr_inflate.c?at=default&fileviewer=file-view-default
https://github.com/github/putty/blob/49fb598b0e78d09d6a2a42679ee0649df482090e/sshzlib.c
https://www.ietf.org/rfc/rfc1951.txt
*/
#include <stdlib.h>
@bitbegin
bitbegin / XClipboard.cpp
Created July 24, 2019 06:36 — forked from bluecube/XClipboard.cpp
Clipboard under X11
#include "Agui/Clipboard/XClipboard.hpp"
#include <X11/Xatom.h>
#include <stdio.h>
#include <sys/select.h>
#include <unistd.h>
#include <assert.h>
#include <algorithm>
#include <iostream>
// Most of the code here is adapted from the example at
@bitbegin
bitbegin / ImpPubKeyFromPriv.c
Created May 28, 2016 14:57 — forked from aleks-f/ImpPubKeyFromPriv.c
CryptoAPI: import public key from private key PEM
#include "windows.h"
#include "wincrypt.h"
#include "stdio.h"
/* This code example:
1) creates a Crypto Service Provider
2) generates keys
3) extracts public key
4) exports private key into PEM