Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

  • Clover Food Lab
View GitHub Profile
@munificent
munificent / generate.c
Last active May 7, 2024 06:19
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditorInternal;
#endif
@thomasballinger
thomasballinger / subprocess.py
Created December 15, 2013 23:26
Using a pseudo-terminal to interact with interactive Python in a subprocess
from subprocess import Popen, PIPE
import pty
import os
from select import select
import sys
import tty
master, slave = pty.openpty()
p = Popen(['python'], stdin=slave, stdout=PIPE, stderr=PIPE)
pin = os.fdopen(master, 'w')
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
public class ColorToCSharp : EditorWindow
{
[SerializeField]
private bool _usedColorPickerOnce = false;
var fs = {
read: (filename, cb, err) => {
navigator.webkitPersistentStorage.requestQuota(0, (bytes) => {
window.webkitRequestFileSystem(PERSISTENT, bytes, (fs) => {
fs.root.getFile(filename, {},
(entry) => {
entry.file((file) => {
var reader = new FileReader();
if(err)
reader.onerror = err;
@CornuAmmonis
CornuAmmonis / splittwit.sh
Last active June 17, 2018 17:08
Shell script that uses twurl to upload a chunked native video to Twitter.
file=""
tweet=""
if [ -n "$1" ]
then
file="$1"
else
echo "Usage: splittwit /path/to/video.mp4 \"My tweet goes here!\""
exit
fi
(ns creator.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[cljs.core.async :as async :refer [chan <! >! put!]]
[om-tools.core :refer-macros [defcomponent]]
[cljs.reader :as reader]
[goog.dom :as gdom]
[om-tools.dom :as dom :include-macros true])
(:import [goog.net XhrIo]))
(import [UnityEditor RagdollBuilder])
;-)
(defn- invoke-private [obj meth & args]
(.Invoke
(.GetMethod
(type obj) meth
(enum-or BindingFlags/Instance
BindingFlags/NonPublic))
obj
@vizanto
vizanto / Function.hx
Last active January 14, 2017 15:41
Haxe / Clojure interop experiments
//
// Nasty code below:
//
package java.internal;
import java.internal.Runtime;
/**
* These classes are automatically generated by the compiler. They are only
* here so there is an option for e.g. defining them as externs if you are compiling
* in modules (untested)