Skip to content

Instantly share code, notes, and snippets.

@nil-ableton
nil-ableton / ctime.c
Last active Jul 19, 2019 — forked from mmozeiko/ctime.c
ctime.c
View ctime.c
/* ========================================================================
$File: tools/ctime/ctime.c $
$Date: 2016/05/08 04:16:55PM $
$Revision: 7 $
$Creator: Casey Muratori $
$Notice:
The author of this software MAKES NO WARRANTY as to the RELIABILITY,
SUITABILITY, or USABILITY of this software. USE IT AT YOUR OWN RISK.
View CoreAnimationNotes.md

@url: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html

Notes about using Core Animation for Macos applications.

Introducing Core Animation

For graphics, Apple describes Core Animation as the level just below AppKit. Therefore anything we would like to achieve with AppKit has to be provided via Core Animation already.

Core Animation's main purpose is to composite layers of bitmap content onto the display. Layers are arranged in trees and their properties are animated by Core Animation.

@nil-ableton
nil-ableton / self_reference_monster.cpp
Last active Mar 29, 2017
self reference and copy ability / movability
View self_reference_monster.cpp
#include <cstddef>
#include <cstdint>
#include <cstdio>
// ptr_to_buffer make this struct not a regular type, i.e.
// not trivially copyable/moveable
struct StructA {
char* const ptr_to_buffer = buffer; // dependency to representation
size_t const buffer_size = sizeof buffer;
char buffer[64];
View complexity-and-strategy.org

Commentary on Complexity And Strategy by Terry Crowley

new functionality gets harder to add as a system gets more functional.

Diminishing returns from technological advantages

advocates for these new technologies tended to confuse the productivity

View apply-elisp-to-many-files.el
(require find-lisp)
(defun map-find (root-dir fn)
(dolist (filename (find-lisp-find-files root-dir ".*\\.\\(cpp\\|h\\)$"))
(with-current-buffer (find-file-noselect filename)
(apply fn)
(save-buffer)))
@nil-ableton
nil-ableton / debug_win32.ipp
Created Jan 26, 2017
Formatted debug traces on win32
View debug_win32.ipp
#pragma once
// <DEBUG WIN32 SNIPPET...
__pragma(warning(push, 1))
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
__pragma(warning(pop))
#include <sstream>
struct Win32Debug
@nil-ableton
nil-ableton / clmacro.cpp
Last active Jun 7, 2016
spaces in macro and boost::icl
View clmacro.cpp
/*
Encountered while building with FASTbuild cache on a library using boost::icl
See element_iterator.hpp and ICL_INTERVAL_TYPE.
FASTbuild uses cl.exe -P to produce a pre-processed file. That file gets a const stitched onto it.
Steps to reproduce:
1- compile with cl.exe clmacro.cpp
2- compile with cl.exe -P -Ficlmacro.i.cpp clmacro.cpp && cl.exe clmacro.i.cpp
@nil-ableton
nil-ableton / voidstar.c
Last active Aug 29, 2015
void* is special in C, C99, C11
View voidstar.c
/**
* Local Variables:
* compile-command: "cc -Wall -Weverything -std=c11 voidstar.c -o ./voidstar && ./voidstar"
* End:
*/
#include <stdio.h> // for printf
enum WorkType
{