Instantly share code, notes, and snippets.

apfeltee / xmlgen.cpp
Created Jul 17, 2016
Primitive XML/HTML writer in plain C++, modeled after javascript.
View xmlgen.cpp
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <vector>
class Element
apfeltee / download-progress.rb
Created Jan 20, 2016 — forked from Burgestrand/download-progress.rb
Ruby HTTP file download with progress measurement
View download-progress.rb
require 'net/http'
require 'uri'
def download(url) do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url, url.port).request_get(url.path) do |response|
View s2num.cpp
// uses algos from
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <gmpxx.h>
template<typename Type>
void pv(const std::string name, const std::vector<Type>& vec)
View BetterHN for Stylish (Based on Georgify).css
@charset "utf-8";
background-color: #ffffff!important;
tbody tr td
background-color: #ffffff!important;
table tbody
View crystal.xml
<UserLang name="Crystal" ext="cr ecr" udlVersion="2.1">
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
<Keywords name="Comments">00# 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
apfeltee / jit.c
Last active Aug 29, 2015 — forked from skeeto/jit.c
View jit.c
/* */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#define PAGE_SIZE 5000