Skip to content

Instantly share code, notes, and snippets.

View jvanwinden's full-sized avatar

Joris van Winden jvanwinden

  • Nederland
View GitHub Profile
@jvanwinden
jvanwinden / regex
Last active August 29, 2015 14:13
eregex
ERE:
unbackslashed:
basic:
^$
.
[](){}
extended:
?+|
backslashed:
gnu:
@jvanwinden
jvanwinden / y.lisp
Created January 7, 2015 21:57
Common Lisp Y-combinator
(defun Y-combinator (f)
((lambda (h)
(funcall h h))
(lambda (self)
(funcall
f
(lambda (&rest args)
(apply
(funcall self self)
args)))))
@jvanwinden
jvanwinden / ringbuffer.h
Last active February 4, 2020 21:19
C++ Ringbuffer
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
#include <stdexcept>
template <class T>
class Ringbuffer {
public:
explicit Ringbuffer(const int size);
~Ringbuffer();
@jvanwinden
jvanwinden / message
Created April 16, 2014 17:14
Git commit message
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the present tense: "Fix bug" and not "Fixed
public static String read(URL url) throws IOException {
Reader reader = new InputStreamReader(new BufferedInputStream(url.openStream()));
String data = "";
while(reader.ready()) {
data += (char) reader.read();
}
return data;
}