Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Isolation

crcdng i3games

:octocat:
Isolation
View GitHub Profile
@i3games
i3games / Unity3D tips.md
Last active Aug 2, 2020
A few learnings from working with Unity3D https://unity.com/ (regularly updated)
View Unity3D tips.md

Unity3D tips

1. Avoid creating objects inside the game loop.

Unfortunately one of the first things you see in many Unity game tutorials is a mistake.

Wrong:

using System.Collections;
@i3games
i3games / mta_td.md
Last active Jul 3, 2020
How to get MTA live data in TouchDesigner
View mta_td.md

How to get New York city subway live data in TouchDesigner

This is a short write up on how I am getting live data from the New York city subway https://new.mta.info/ (metro, underground, U-Bahn, however you call it) in TouchDesigner https://derivative.ca/. It is a bit terse and requires some tinkering, installing, using git and changing settings. Hit me up on Twitter if you have any questions (https://twitter.com/crcdng).

Many live data feeds come with a REST API where you can call a web service and get data back back in JSON format. The realtime subway data uses a different mechanism called GTFS Realtime, which is based on Protocol Buffers (https://developers.google.com/transit/gtfs-realtime/). I believe you can get the data in JSON format for Google Maps, but here I will retrieve it directly with Python, the included scripting language of choice in TouchDesigner.

Before retrieving the data within Touch, I will get it with a Python script running outside of Touch. The reasons are (1) in this way the ne

@i3games
i3games / pd_crash_on_startup.md
Last active Jun 14, 2020
An old bug that causes pure data (https://puredata.info/) to crash at startup.
View pd_crash_on_startup.md

pd startup crash

When pure data (https://puredata.info/) crashes at startup, open the sketch with a text editor.

If you see a minus in a line like this

#N canvas 38 -769 692 735 12;

delete the minus

@i3games
i3games / p5_catalina_dev.md
Last active Jul 11, 2020
How to fix Processing on MacOSX 15 Catalina
View p5_catalina_dev.md

How to fix Processing (https://processing.org) Camera and Microphone on macOS 10.15 Catalina

This solution requires that you are a member of the Apple Developer program

Last updated on 2020_06_16

Apple has been changing around things for developers quite a lot since 2019. This concerns (among others):

  • newly required permissions for apps that access the camera and microphone
  • the removal of 32 bit applications
  • the "notarization" mechanism
View 99-bottles.dart
// http://www.99-bottles-of-beer.net/
void main() {
for (int beer = 99; beer >= 0; beer--) {
String bottles = beer > 1 ? "bottles" : "bottle";
String bottlesLeft = beer == 1 ? "no more" : (beer - 1).toString();
String leftBottles = beer == 2 ? "bottle" : "bottles";
String beerline =
'$beer $bottles of beer on the wall, $beer $bottles of beer.\nTake one down and pass it around, $bottlesLeft $leftBottles of beer on the wall.';
String lastline =
@i3games
i3games / main.dart
Last active Feb 22, 2020
Dart Future example
View main.dart
import 'dart:async';
import 'dart:math';
void main() {
print("The main UI thread starts here.");
print("Now it will take 10 seconds to display news headlines.");
displayNews();
print("The main UI thread ends.");
}
@i3games
i3games / main.dart
Last active Feb 8, 2020
Flutter Animated Canvas Example
View main.dart
// flutter animated canvas example
// by @crcdng
// adapted from https://medium.com/flutter-community/flutter-custom-painter-circular-wave-animation-bdc65c112690 by @divyanshub024
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
@i3games
i3games / main.dart
Last active Feb 8, 2020
Flutter Static Canvas Example
View main.dart
// flutter static canvas example
// by @crcdng
// adapted from https://medium.com/flutter-community/flutter-custom-painter-circular-wave-animation-bdc65c112690 by @divyanshub024
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
@i3games
i3games / headless-pi.md
Last active Apr 13, 2020
How to set up your Raspberry Pi including WiFi without monitor and keyboard from a Mac.
View headless-pi.md

Set up Your Raspberry Pi Headless in 10 Easy 🤔 Steps

Goal

You want to set up your Raspberry Pi without monitor and keyboard. This is sometimes called "headless". Don't worry, you'll keep your head if you follow these step-by-step instructions (however, see license and disclaimer below). We will install the Raspbian operating system and configure the Pi WiFi from a Terminal session on a Mac.

Prerequisites / Assumptions

You have:

  • A Mac with a SD card reader (either built in or an USB device).
  • A Raspberry Pi 3 B (A Pi 2 B with a compatible WiFi dongle works as well).
View happy birthday
console.log((+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[
You can’t perform that action at this time.