Skip to content

Instantly share code, notes, and snippets.

View nasser's full-sized avatar
🛰️
save-lisp-and-die

Ramsey Nasser nasser

🛰️
save-lisp-and-die
View GitHub Profile
(use 'unity.hydrate)
;; create a new game object named New Object
(hydrate {:name "New Object"})
;; create a new game object named New Object, with a transform with local position 40 20 10
(hydrate {:name "New Object" :transform [{:local-position [40 20 10]}]})
;; create a new game object named New Object, with a transform with local position 40 20 10 and a box collider with center 1 1 2
(hydrate {:name "New Object" :transform [{:local-position [40 20 10]}]
unity.core=> (pprint (dehydrate (object-named "Main Camera")))
{:children [],
:transform
[{:has-changed true,
:rotation (0.0, 0.0, 0.0, 1.0),
:local-position (0.0, 1.0, -10.0),
:parent nil,
:euler-angles (0.0, 0.0, 0.0),
:local-euler-angles (0.0, 0.0, 0.0),
:name "Main Camera",
/*
* Text-to-speech example to speak the first n digits of pi.
* The number is stored in flash, each digit is spoken one at a time.
*/
#include <WaveHC.h>
#include <WaveUtil.h>
SdReader card; // This object holds the information for the card
FatVolume vol; // This holds the information for the partition on the card
FatReader root; // This holds the information for the volumes root directory
<meta charset="utf-8">
<script src="js/jquery.js"></script>
<script src="js/jqconsole.js"></script>
<script src="js/sugar.js"></script>
<script src="js/peg.js"></script>
<script src="js/plt.js"></script>
<script type="text/javascript">
// uncomment next line to enable refresh
@nasser
nasser / hw1.html
Last active August 29, 2015 14:07
SFPC Grammar Homework 1
<meta charset="utf-8">
<script src="js/jquery.js"></script>
<script src="js/jqconsole.js"></script>
<script src="js/sugar.js"></script>
<script src="js/peg.js"></script>
<script src="js/plt.js"></script>
<script type="text/javascript">
// uncomment next line to enable refresh
(ns hooks
(:use arcadia.core))
(defmacro invoke-if-bound [sym]
`(if-let [~sym ((ns-map '~'user) '~sym)]
(~sym)))
; via jplur_ ;)
(defcomponent Hooks []
(Start [this]
(.GetMethods UnityEngine.Vector3)
(.GetMethods UnityEngine.Vector3 (enum-or BindingFlags/Static BindingFlags/Public))
(.GetMethod UnityEngine.Vector3 "Lerp")
(.GetMethod UnityEngine.Vector3 "op_Addition")
@nasser
nasser / gist:dee66c3c8847bb0c4ae2
Last active August 29, 2015 14:08
Kindle Hacks
from http://www.mobileread.com/forums/showthread.php?t=195702&page=2
[General]
unpack=true
debootstrap=Grip
aptsources=Debian
[Grip]
packages=ntpdate udev lrzsz netcat telnetd
source=http://www.emdebian.org/grip
(ns user
(:use arcadia.core)
(:import [UnityEngine
Vector3
Time
Gizmos
Color
Debug
Plane
Mathf]))
@nasser
nasser / gist:f62cbe299983e22a51e5
Created October 26, 2014 07:47
Mesh Generation
(let [m (.mesh (get-component (object-named "mesh") UnityEngine.MeshFilter))]
(set!
(.vertices m)
(into-array [(v 0 0 0)
(v 0 0 1)
(v 0 1 1)
(v 0 1 0)
(v 2 0.5 0.5)
]))
(set!