This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
{spawn, exec} = require 'child_process' | |
path = require 'path' | |
# Requires that you 'npm install findit' | |
findit = require 'findit' | |
SRCDIR="./src" | |
TGTDIR="./build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tuple> | |
#include <iostream> | |
#include <vector> | |
#include <list> | |
#include <algorithm> | |
#include <iterator> | |
/* This is an attempt to translate the Boost-oriented demo of C++14 | |
from the O'Reilly handout "C++ Today: The Beast Is Back" | |
(http://www.oreilly.com/programming/free/files/c++-today.pdf) into |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
typedef std::function<int(int)> Addable; | |
int addem(int start) { | |
std::cout << "Add: " << start << std::endl; | |
return start + 10; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <err.h> | |
#include <iostream> | |
#include <cstdint> | |
#include <sys/mman.h> | |
#include <sysexits.h> | |
#include <unistd.h> | |
/* Compiles with clang 3.9. | |
clang++ -std=c++11 -o babyjit babyjit.cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Macros for the '&' and '|' operators in Hy. The '&' and '|' symbols aren't very friendly to the Hy | |
; parser, and the operator version is a binary operator; extending it required a little macro magic, | |
; and it taught me a lot about Hy macros. | |
(import operator) | |
(defmacro/g! bwor (&rest args) | |
(let [[g!handler (fn [args] | |
(if (> (len args) 2) | |
`(operator.__or__ ~(car args) ~(g!handler (cdr args))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
/* An implementation of Bob Nystrom's "Baby's First Garbage Collector" | |
http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/, | |
only in C++, and with some educational stuff along the way about | |
the new Variant (automagical discriminated unions) coming in | |
Libstdc++ version 4, part of the C++ 2017 standard. | |
*/ | |
/* Requires the mapbox header-only variant found at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Baby's First JIT, Rust Edition | |
Example derived from Curtis McEnroe's Baby's first JIT, C Version: | |
https://cmcenroe.me/2016/10/13/babys-first-jit.html | |
Works with Rustc 1.15. No guarantees or warranties. License is CC-BY, | |
summary at the end. | |
You'll need these dependencies in your Cargo.toml. Then replace your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script automatically configures and runs various games found on | |
# the Official Williams Arcade Greatest Hits CD via the dosbox | |
# emulator. To use, run the INSTALL script for the script and install | |
# the contents somewhere reliable, then change ARCADE_HOME to point to | |
# the parent directory, presumably the root of your emulated C: drive. | |
# | |
# The embedded configuration file is currently set for the audio features | |
# of Ubuntu 16, and fullscreen emulation. It requires dosbox. It may |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# A small script that I use to keep track of what's currently in my "Projects" directory. | |
# Not a big deal, but maybe useful to someone. I have a fairly disciplined layout for | |
# my projects so this helps me keep track of my to-dos. | |
import os | |
PROJECTS = os.path.join(os.path.expanduser("~"), "Projects") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env hy | |
; This script requires `pip install slugify newspaper`. It runs on Hy 0.12 and Python 3.5. | |
; This is part of an (incomplete) xinetd-driven toolchain for managing local bookmarks. | |
(import sys os os.path [slugify [slugify]] [newspaper [Article]]) | |
(def bookmark-index | |
(os.path.join (get os.environ "HOME") "Wiki" "Bookmarks" "Bookmarks.org")) |
OlderNewer