Skip to content

Instantly share code, notes, and snippets.

View berkus's full-sized avatar
🎯
Haptic drift

Berkus Decker berkus

🎯
Haptic drift
View GitHub Profile
class utf8_text_view {
const char *text;
size_t bytes_count;
public:
friend class iterator;
class iterator {
const utf8_text_view &parent;
size_t offset;
public:
@berkus
berkus / Real World Specification.md
Created March 2, 2018 10:30 — forked from ForbesLindesay/Real World Specification.md
Functional Programming from the perspective of a JavaScript Programmer.

Real World Specification

(aka "Algebraic JavaScript Specification")

This project specifies the behavior of a number of methods that may optionally be added to any object. The motivation behind this is to encourage greater code reuse. You can create functions that just rely on objects having implementations of the methods below, and in doing so you can make them work with a wide variety of different, but related data structures.

Definitions

For the purposes of this, spec, an "entity" is an object that has an [[equivalent]] operation (see bellow) and may implement some or all of the other methods.

@berkus
berkus / spectre.c
Created January 6, 2018 02:26 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
//
// RemoteEntity.h
//
// Created by Christopher Bradford on 5/6/10.
// Copyright 2010 INM United. All rights reserved.
//
@interface RemoteEntity : NSManagedObject
{
# Copyright (C) 2011 Anurag Priyam - MIT License
module Jekyll
# Jekyll plugin to generate tag clouds.
#
# The plugin defines a `tag_cloud` tag that is rendered by Liquid into a tag
# cloud:
#
# <div class='cloud'>
//
// SWFHTTPClient
// RACCancelTest
//
// Created by Nikolay Kasyanov on 29.03.13.
// Copyright (c) 2013 Softwear Finance. All rights reserved.
//
#import "SWFHTTPClient.h"
@implementation SWFHTTPClient {
;
; Selfer.
;
; Shikhin Sethi, the author of selfer, has dedicated the work to the public domain
; by waiving all of his or her rights to the work worldwide under copyright law,
; including all related and neighboring rights, to the extent allowed by law.
;
; You can copy, modify, distribute and perform the work, even for commercial purposes,
; all without asking permission.
;
;
; Selfer.
;
; Shikhin Sethi, the author of selfer, has dedicated the work to the public domain
; by waiving all of his or her rights to the work worldwide under copyright law,
; including all related and neighboring rights, to the extent allowed by law.
;
; You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
;
; https://creativecommons.org/publicdomain/zero/1.0/
@berkus
berkus / index.html
Last active December 13, 2015 18:08 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<div style="max-width:600px; -webkit-transform:rotate(0deg);">
<scene id="scene1" width="400px">
<label t="translate(0,346) rotate(-3)">
<tspan x="0" y="0em">One crazy day</tspan>