Skip to content

Instantly share code, notes, and snippets.

@griotspeak
griotspeak / update-swift-dev
Created May 18, 2017 02:12 — forked from CodaFi/update-swift-dev
This is the script I currently use on OS X to get a working "swift-dev.xctoolchain" out of a built Swift. It isn't designed to work for anyone but me, but it should be easy to adapt. I always run this after every build, and then use `TOOLCHAINS=swift-dev swift build` (etc) to use the development compiler.
#!/bin/sh
####################################################
# HEY! set SWIFT_SOURCE_PATH or nothing will work. #
####################################################
set -e
if [ -z "${SWIFTPM_CONFIGURATION}" ]; then
SWIFTPM_CONFIGURATION=lib/swift/pm/4
@griotspeak
griotspeak / Settings.swift
Created September 21, 2016 01:31 — forked from anonymous/Settings.swift
SwiftInSwift - A poor man's meta programming tool for Swift
//-----------------------------------------------------------------------------
// Settings.swift
// SwiftInSwift
//-----------------------------------------------------------------------------
let appName = "SwiftInSwift"
let defBlockPrefix = "// DEF-{"
let defBlockSuffix = "// }-DEF"
@griotspeak
griotspeak / MicroKanren.hs
Created May 4, 2016 21:37 — forked from msullivan/MicroKanren.hs
MicroKanren (μKanren) in Haskell
import Control.Monad
type Var = Integer
type Subst = [(Var, Term)]
type State = (Subst, Integer)
type Program = State -> KList State
data Term = Atom String | Pair Term Term | Var Var deriving Show
-- Apply a substitution to the top level of a term
@griotspeak
griotspeak / uKanren.scala
Created May 4, 2016 21:33 — forked from adamnew123456/uKanren.scala
microKanren In Scala
/**
* An implementation of microKanren (and probably most of miniKanren), with
* a few extras. Currently, it supports:
*
* - The essential core of microKanren: Unify, Fresh, Disjunction, Conjunction
* - Standard terms: Variables, Atoms, TermCons, EmptyTerm.
* - An implicit conversion from type T to Atom[T]. This makes writing programs
* much easier.
* - A decent reifier, which converts terms to strings.
*
//
// NUIBezierPath.h
// NUIKit
//
// Created by Robert Widmann on 10/11/13.
// Copyright (c) 2013 CodaFi. All rights reserved.
// Released under the MIT license.
//
#import <Foundation/Foundation.h>
@griotspeak
griotspeak / unix_instruments.sh
Created October 25, 2012 02:11 — forked from jonathanpenn/unix_instruments.sh
Make Instruments play nice with unix by returning > 0 status code if build fails
#!/usr/bin/env bash
#
# Copyright (c) 2012 Jonathan Penn (http://cocoamanifest.net)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@griotspeak
griotspeak / nah_xcode_uncrustify.rb
Created October 23, 2012 01:59 — forked from mnem/nah_xcode_uncrustify.rb
Script file to be run as an Xcode 4 behaviour which uncrustifies the project source using reasonable Objective-C formatting defaults. Alternatively, you can run it and pass a path to uncrustify.
#!/usr/bin/env ruby
###########################################################################
# Script to be called as an Xcode 4 behaviour which will attempt to
# uncrustify all source files in the open project.
#
# (c) Copyright 2012 David Wagner.
#
# Complain/commend: http://noiseandheat.com/
#
#*************************************************************************#