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
@Yonezpt
Yonezpt / YT RMV-AP-UN.user.js
Last active January 30, 2022 04:37
Removes the autoplay up next feature
// ==UserScript==
// @version 1.0.2
// @name Removes the autoplay up next feature
// @match *://www.youtube.com/*
// @run-at document-start
// @grant none
// @noframes
// ==/UserScript==
(function () {
'use strict';
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;
@mcpherrinm
mcpherrinm / instructions.md
Last active October 25, 2015 02:35
Crosscompiling Rust to Arm

I want to write Rust code on my computer (x86_64, Ubuntu 14.04) and produce arm executables. I found hints on the internet, but not a concise set of instructions on what to do. So I wrote them down exactly:

apt-get install g++-arm-linux-gnueabihf
git clone https://github.com/mozilla/rust.git
mkdir rust/build-cross
cd rust/build-cross
../configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/local/rust-cross
make -j8 && make install
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
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;