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 <algorithm> | |
#include <array> | |
#include <iostream> | |
#include <vector> | |
using std::vector; | |
using std::cout; | |
using std::cin; | |
using std::endl; |
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
(defn optify | |
"Helper that examines paths with the supplied prefix and either subs | |
in their cache-busting URLs or returns them unchanged." | |
[req prefix] | |
(fn [^String src] | |
(or (and (.startsWith src prefix) | |
(not-empty (link/file-path req src))) | |
src))) | |
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
# Makefile | |
.PHONY: help deps | |
SHELL := /bin/bash | |
export PATH := bin:$(PATH) | |
help: | |
@echo "Usage: make {deps|help}" 1>&2 && false | |
bin/boot: |
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
module StdFolds where | |
myOr :: [Bool] -> Bool | |
myOr = foldr (||) False | |
myAny :: (a -> Bool) -> [a] -> Bool | |
myAny = flip foldr False . ((||) .) | |
myElem :: Eq a => a -> [a] -> Bool | |
myElem = myAny.(==) |
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
namespace Day7 | |
module util = | |
let thing = 0 | |
module part1 = | |
let execute inputFile = 0 | |
module part2 = | |
let execute inputFile = 0 |
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
CXX=clang++ -std=c++11 | |
FLAGS=-Wall -Wextra -Werror -pedantic -c -g | |
BUILDDIR=build | |
SOURCEDIR=src | |
EXEC=PROJECT-NAME-HERE | |
SOURCES=$(wildcard $(SOURCEDIR)/*.cpp) | |
OBJ=$(patsubst $(SOURCEDIR)/%.cpp,$(BUILDDIR)/%.o,$(SOURCES)) | |
all: dir $(BUILDDIR)/$(EXEC) |
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 <vector> | |
class BenFolds { | |
public: | |
// fold - Fold a binary operation over a vector | |
template <typename T, typename R, typename BinOp> | |
static R fold(std::vector<T> elems, R acc, BinOp func) | |
{ | |
int length = elems.size(); |
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
(* | |
** | |
** A template for single-file ATS programs | |
** | |
*) | |
(* ****** ****** *) | |
// | |
#include "share/atspre_staload.hats" | |
// |
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
/* | |
* Discussion post code sample | |
* Benjamin Lovy | |
*/ | |
#include <iostream> | |
class Animal | |
{ | |
public: |
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 <stdio.h> | |
int main(void) | |
{ | |
char *greeting = "Hello, World!"; | |
printf("%s\n", greeting); | |
return 0; | |
} |
OlderNewer