Skip to content

Instantly share code, notes, and snippets.

@Bananattack
Bananattack / ai_wander.wiz
Last active April 17, 2018 04:36
Top-down NES demo in Wiz, using the current work-in-progress of the language. There are some weird things in here, but hopefully some revisions will iron out some of the strange stuff.
import "ram";
import "entity";
import "directions";
import "random";
namespace ai_wander {
const direction_wait_base : [u8] = [60];
const direction_wait_random : [u8] = [60];
const wander_speed_lo : [u8] = [128];
const wander_speed_hi : [u8] = [0];
import * as ts from 'typescript'
import { Rules, RuleWalker, RuleFailure } from 'tslint'
function find<T>(collection: T[], predicate: (it: T) => boolean): T | null {
for (const item of collection) {
if (predicate(item)) {
return item
}
}
return null
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
------------------------------
Relevant links:
http://en.wikipedia.org/wiki/Types_of_mesh
http://en.wikipedia.org/wiki/Tetrahedron
http://en.wikipedia.org/wiki/Simplicial_complex
@elib
elib / broken_vhs.pde
Created October 1, 2014 14:42
"Broken VHS" effect for static image
float sidepercent = 6;
//10-20 -> amazing horizontals
//100 -> painterly
float initialChanceOfChunkGrab = 15;
float chanceOfChunkGrab;
float chanceOfChunkGrabChange = 10;
@branneman
branneman / better-nodejs-require-paths.md
Last active August 28, 2024 01:17
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@StefanoRausch
StefanoRausch / Default (OSX).sublime-keymap
Created February 14, 2013 16:26
Sublime : 2 Columns Layout Management
[
{ "keys" : [ "alt+1" ], "command" : "focus_group", "args" : { "group" : 0 } },
{ "keys" : [ "alt+2" ], "command" : "focus_group", "args" : { "group" : 1 } },
{ // workspace left
"keys" : [ "ctrl+alt+super+left" ],
"command" : "run_multiple_commands",
"args" : {
Shader "VertexInputSimple" {
Properties {
_SoundWavePosition ("Sound Wave Position", Vector) = (0,0,0,0)
_SoundWaveRange ("Sound Wave Range", Float) = 2.0
_SoundWaveWidth ("Sound Wave Width", Float) = 0.1
_MainTex ("Texture", 2D) = "white" {}
}
@henkboom
henkboom / SceneData.cs
Created October 16, 2012 15:32
Data that expires on scene close. (Unity)
using UnityEngine;
using System.Collections.Generic;
// Data that expires on scene close.
// Pretty much a hack, there must be a better way!
class SceneData<T> where T : class
{
GameObject go;
T data;