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
#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 |
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 [UnityEditor RagdollBuilder]) | |
;-) | |
(defn- invoke-private [obj meth & args] | |
(.Invoke | |
(.GetMethod | |
(type obj) meth | |
(enum-or BindingFlags/Instance | |
BindingFlags/NonPublic)) | |
obj |
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
using UnityEngine; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
using UnityEditorInternal; | |
#endif |
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
(ns realize.core | |
(:use arcadia.core) | |
(:require [clojure.string :as string])) | |
(defn- reflective-set! [obj field value] | |
(if-let [^System.Reflection.FieldInfo info (.GetField (type obj) (str field))] | |
(.SetValue info obj value) | |
(if-let [^System.Reflection.PropertyInfo info (.GetProperty (type obj) (str field))] | |
(.SetValue info obj value nil) | |
(throw (Exception. (str "No field or property '" field "' on object of type " (type obj))))))) |
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
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class ColorToCSharp : EditorWindow | |
{ | |
[SerializeField] | |
private bool _usedColorPickerOnce = false; |
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 Undo) | |
(import |System.Collections.Generic.List`1|) | |
(let [method (.GetMethod Undo "GetRecords" (enum-or BindingFlags/NonPublic | |
BindingFlags/Static)) | |
undos (|System.Collections.Generic.List`1[System.String]|.) | |
redos (|System.Collections.Generic.List`1[System.String]|.)] | |
(.Invoke method Undo (into-array [undos redos])) | |
[undos redos]) | |
;; [("Selection Change" "Create Empty Game Object" "Selection Change" | |
;; "Selection Change" "Selection Change" "Selection Change" "Rename GameObject") |
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
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; |
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
(defrecord Face [vertices normal] | |
IHashEq | |
(hasheq [this] (bit-xor (.hasheq (.vertices this)) | |
(.GetHashCode (.normal this)))) | |
Object | |
(ToString [this] (str "#Face[" (.normal this) " " (.vertices this) "]")) | |
IPersistentCollection | |
(count [this] (count (.vertices this))) |
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
var imgs = document.querySelectorAll("div.rg_di.rg_el.ivg-i img") | |
for(var i=0; i<imgs.length;i++) { | |
imgs[i].src = imgs[i].parentNode.href.match(/\?imgurl=([^&]+)&/)[1]; | |
imgs[i].parentNode.removeAttribute("href"); | |
} |
NewerOlder