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
import Foundation | |
import Cocoa | |
import Photos | |
class PhotoExporter { | |
let imageManager = PHImageManager.default() | |
func exportPhoto(withLocalIdentifier identifier: String, to destinationURL: URL) { | |
// Fetch the asset with the specified identifier |
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
import Foundation | |
import UIKit | |
// Turn a decimal number into a fractional approximation rounded to a maximum denominator | |
// https://github.com/jadengeller/fractional? | |
// https://stackoverflow.com/questions/35895154/decimal-to-fraction-conversion-in-swift#35895607 | |
typealias Rational = (whole: Int, numerator: Int, denominator: Int) | |
func decimalToRational(of value: Double, withDenominator denominator: Int) -> Rational { |
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/python | |
# Script to automate downloading CSV files from GoogleDocs into the lens asset folders | |
# Note that google broke password authentication in April 2015, so the interface changed slightly | |
# to use the oauth-supporting library gspread. | |
# | |
# Expects a Google oauth key file named google_oauth_key.json, created and downloaded | |
# from http://console.developers.google.com | |
# | |
# Usage example: |
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
// Quick sketch to log brain data to a CSV | |
// Untested!!! | |
// Based on https://github.com/kitschpatrol/BrainGrapher | |
// Expects data from https://github.com/kitschpatrol/Brain | |
// Eric Mika Spring 2018 | |
import processing.serial.*; | |
Serial serial; | |
Table table; |
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
// Mindflex --> Arduino --> Processing --> OSC --> PD | |
// Eric Mika Jan 2018 | |
import processing.serial.*; | |
import netP5.*; | |
import oscP5.*; | |
Serial serial; | |
OscP5 oscProcessing; | |
NetAddress oscPD; |
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
int frame = 0; | |
int wallOffset = 0; | |
final int windowWidth = 1; | |
final int wallWidth = 4; | |
boolean isDrawWallEnabled = false; | |
boolean isWallAnimated = true; | |
PImage pattern; | |
void setup() { |
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
cloudy blue #acc2d9 | |
dark pastel green #56ae57 | |
dust #b2996e | |
electric lime #a8ff04 | |
fresh green #69d84f | |
light eggplant #894585 | |
nasty green #70b23f | |
really light blue #d4ffff | |
tea #65ab7c | |
warm purple #952e8f |
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
--- | |
Language: Cpp | |
AccessModifierOffset: -2 | |
AlignAfterOpenBracket: false | |
AlignConsecutiveDeclarations: true | |
AlignConsecutiveAssignments: false | |
AlignEscapedNewlinesLeft: false | |
AlignOperands: false | |
AlignTrailingComments: false | |
AllowAllParametersOfDeclarationOnNextLine: true |
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
ArrayList<Widget> widgets = new ArrayList<Widget>(); | |
void setup() { | |
size(500, 500); | |
// Create widgets | |
for (int i = 0; i < 100; i++) { | |
widgets.add(new Widget()); | |
} |
NewerOlder