Skip to content

Instantly share code, notes, and snippets.

import java.security.*;
import java.util.*;
static class Utils {
static void saveImage(PApplet applet) {
int i = 0;
File file = null;
String fileName = null;
do {
i++;
@troughton
troughton / swiftbuild
Last active April 13, 2016 05:06
Swift Build Script
swiftc --driver-mode=swift -lPackageDescription Package.swift -fileno 3
swiftc --driver-mode=swift -lPackageDescription Packages/SGLOpenGL-2.0.2/Package.swift -fileno 4
swiftc --driver-mode=swift -lPackageDescription Packages/CGLFW3-1.0.0/Package.swift -fileno 4
swift-build-tool -f .build/debug.yaml default -v
swiftc -Xlinker -LPackages/CGLFW3-1.0.0 -g -L.build/debug -o .build/debug/SwiftGLTest -emit-executable .build/debug/SwiftGLTest.build/main.swift.o .build/debug/SGLOpenGL.build/Commands.swift.o .build/debug/SGLOpenGL.build/Constants.swift.o .build/debug/SGLOpenGL.build/Loaders.swift.o .build/debug/SGLOpenGL.build/SwiftGL.swift.o
@troughton
troughton / .block
Last active October 6, 2016 03:47 — forked from dribnet/.block
Dimensional Glyph
license: mit
@troughton
troughton / .block
Last active October 6, 2016 03:52 — forked from dribnet/.block
Parameterised Cartoon Faces
license: mit
@troughton
troughton / .block
Last active October 6, 2016 03:52 — forked from dribnet/.block
Feral – A Parametric Font
license: mit
@troughton
troughton / .block
Last active October 11, 2016 03:29 — forked from dribnet/.block
Painterly Weatherbot
license: mit
@troughton
troughton / .purview_helper.js
Last active October 24, 2016 23:52 — forked from dribnet/gist:a0ef81cf281d53066ebb2416c1cae3b4
MDDN 342 Final Project
// note: this file is poorly named - it can generally be ignored.
// helper functions below for supporting blocks/purview
function saveBlocksImages(doZoom) {
if(doZoom == null) {
doZoom = false;
}
// generate 960x500 preview.jpg of entire canvas
@troughton
troughton / main.swift
Last active November 30, 2018 11:17
Swift Tromino Algorithm - Windows Test
import Swift
print("Hello")
struct Position : Hashable {
let x : Int
let y : Int
var hashValue: Int {
return 31 &* x &+ y
@troughton
troughton / swift-windows-crosscompile-instrs.md
Last active April 5, 2019 15:15
Swift Cross-Compilation on Windows 10

Cross-compiling Swift for Windows through the Linux Subsystem for Windows

This tutorial will walk you through the process of compiling your own native programs for Windows using the Ubuntu on Windows. While the development environment and Swift compiler used here will be the standard toolchain for Linux, you'll also be able to cross-compile programs that run natively on Windows like any other executable.

Required Environment

This tutorial assumes a computer running an up-to-date 64-bit version of Windows 10 (at the time of writing, the Fall Creators' Update was the most recent build).

You'll also need Visual Studio 2017; the Community Edition is sufficient, since we'll only be using the SDKs that come with it and some command line tools.

Computer Information:
Manufacturer: Apple
Model: iMacPro1,1
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
CPU Family: 0x6