Skip to content

Instantly share code, notes, and snippets.

View jiri's full-sized avatar

Jiří Šebele jiri

View GitHub Profile
@jiri
jiri / keybase.md
Created August 1, 2017 16:39
Keybase proof

Keybase proof

I hereby claim:

  • I am jiri on github.
  • I am jirisebele (https://keybase.io/jirisebele) on keybase.
  • I have a public key ASCnS6wX3zq6-GUqftY7geaditE0ES20YgNnckEW59hPuwo

To claim this, I am signing this object:

@jiri
jiri / optional.c
Created April 26, 2016 10:27
Optional
#include <iostream>
#include <vector>
template <typename T>
struct Option {
enum {
t_Some, t_None
} tag;
template <typename... Args>
@jiri
jiri / derp.c
Last active March 17, 2016 19:27
#include <stdio.h>
#define return(x) { \
fprintf(stderr, "Leaking data: %d\n", x); \
return x; \
}
int foo() {
return(42);
}
module Main where
import Control.Monad.State
import Data.Sequence hiding (replicate)
import Data.Foldable (toList)
data Buffer = Buffer (Seq Char) (Seq Char)
instance Show Buffer where
show (Buffer pre post) = toList $ pre >< post
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <ncurses.h>
enum state_t {
NORMAL,
INSERT,
#include <iostream>
using namespace std;
template<typename T>
class Ref {
private:
uint32_t *ref_count;
T *ptr;
# Created by Sindri Avaruus <sindriava@gmail.com>
# © 2014, published under the WTFPL.
svg = DATA.readlines.join;
# Loop over the argument array
ARGV.each do |arg|
File.open "#{arg}.svg", 'w' do |f|
f.write svg % { color: "##{arg}" }
end
end