Skip to content

Instantly share code, notes, and snippets.

View html-test.html
View gist:8674393
$ java -jar BlobSlayer2.3.jar
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(
at Board.getImage(
at Board.<init>(
at Game.<init>(
at Game.main(
$ java -version
java version "1.7.0_51"
View lambda-coerce.cpp
// When using first-class functions, c++11 will silently coerce a function returning a value
// into a std::function returning a reference, thus creating a ticking time bomb.
#include <stdio.h>
#include <functional>
const int& f1 (std::function<const int& ()> func) {
return func();
quietfanatic /
Created Apr 25, 2013
A sample for a perl-based build system
use strict;
use warnings;
use FindBin;
BEGIN { %make:: or do { require "$FindBin::Bin/tool/"; make->import(':all') } }
use autodie qw(:all);
my $here;
my @modules;
View murphyme.vim
" local syntax file - set colors on a per-machine basis:
" vim: tw=0 ts=4 sw=4
" Vim color file
hi clear
set background=dark
if exists("syntax_on")
syntax reset
let g:colors_name = "murphyme"
quietfanatic / gist:4242187
Created Dec 8, 2012
Error while installing Bailador
View gist:4242187
==> Bailador depends on HTTP::Easy, Template::Mojo, URI
==> HTTP::Easy depends on HTTP::Status
==> Fetching HTTP::Status
==> Building HTTP::Status
Compiling lib/HTTP/Status.pm6
==> Testing HTTP::Status
t/01-basic.t .. ok
All tests successful.
Files=1, Tests=4, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.40 cusr 0.06 csys = 0.48 CPU)
Result: PASS
View example1-xml
#Implementation of
escape_xml = *.replace(
('<', '&lt;'),
('>', '&gt;'),
('&', '&amp;'),
('"', '&quot;'),
("'", '&apos;'),
quietfanatic / gist:3180344
Created Jul 26, 2012
Pugs: Typename -> Typename()
View gist:3180344
diff --git a/Pugs/src/Pugs/AST/Internals.hs b/Pugs/src/Pugs/AST/Internals.hs
index cf984b1..afead2e 100644
--- a/Pugs/src/Pugs/AST/Internals.hs
+++ b/Pugs/src/Pugs/AST/Internals.hs
@@ -1166,7 +1166,7 @@ instance Value VStr where
fromVal (VList l) = return . unwords =<< mapM fromVal l
fromVal v@(PerlSV _) = fromVal' v
fromVal VUndef = return ""
- fromVal (VType t) = return (showType t)
+ fromVal (VType t) = return (showType t ++ "()")
quietfanatic / structarray.cpp
Created Jun 21, 2012
C++11 struct-array hybrid
View structarray.cpp
// Struct-Array Hybrids
// In many situations it is useful to have a static collection of objects
// that can be accessed either by name or by number.
// Previously, you would have to declare an array of unnamed items, followed
// by either an enum or a series of const references. This made it difficult
// to modify by hand and to ensure that the right names were matched to the
// right objects. It also took twice as many code lines.
quietfanatic / if.c++
Created Jun 14, 2012
Go-style interfaces in C++
View if.c++
#include <stdio.h>
class Talking {
// Vtable
template <class T>
struct implemented_by {
void (T::* talk ) ();
void (T::* talk__int ) (int);
static const implemented_by vtable;
You can’t perform that action at this time.