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
@nasser
nasser / gist:fb0679e3c59624725f50
Created August 21, 2014 01:19
Oniguruma Failing on OSX
$ npm install oniguruma
/
> [email protected] install /Users/nasser/Scratch/wtf/node_modules/oniguruma
> node-gyp rebuild
CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
@nasser
nasser / changes.patch
Created August 21, 2014 01:32
Patch to atom shell to get it to compile
diff --git a/package.json b/package.json
index f3edb8f..2927bac 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,6 @@
],
"devDependencies": {
- "atom-package-manager": "0.89.0",
"coffee-script": "~1.7.1",
@nasser
nasser / islands.geojson
Last active August 29, 2015 14:05
Small Islands Of New York
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
--> (.. (GameObject/Find "Main Camera") transform localPosition x)
0.0
--> (.. (GameObject/Find "Main Camera") camera rect xMax)
1.0
--> (.. (GameObject/Find "Main Camera") camera fieldOfView)
60.0
user=> (require 'unity.hydrate)
clojure.lang.Compiler+AssemblyInitializationException: Error initializing unity.hydrate.clj, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for __Init__$unity/hydrate ---> System.TypeLoadException: Could not load type 'UnityEngine.HumanFingerBones' from assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
at __Init__$unity/hydrate..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalizati
using UnityEngine;
using System.Collections;
public class SoundOnCollision : MonoBehaviour {
void OnCollisionEnter () {
audio.Play();
}
}
// declare a class called Phone
class Phone {
/*
declare its data (called 'fields' in C#) like you declare varibales
1. the access: public, private, protected etc. use public if you want
other classes to have access to this field. if you leave this off
it defaults to private
2. the type: what kind of data will be stored in this variable
3. the name: what name you will refer to this data by
*/
ar = open("ar.txt").read
ar.force_encoding "utf-8"
print ar.split.map { |e| e.strip }.
reject { |e| e =~ /\d|\w/ }.
reject { |e| e.length > 2 }.
join("\n")
AppDomain domain = AppDomain.CurrentDomain;
Assembly[] assys = domain.GetAssemblies();
List<Type> candidateTypes = new List<Type>();
+
+ Console.WriteLine(" * Fast Path(" + p + ")");
+ foreach (Assembly assy in assys)
+ {
+ Type t1 = assy.GetType(p, false);
+ if(t1 != null)
+ return t1;
@nasser
nasser / gist:800e4bde780067cdef14
Last active August 29, 2015 14:07
shadowing in clojure
(import java.text.DateFormat)
java.text.DateFormat
user=> (DateFormat/getInstance)
#<SimpleDateFormat java.text.SimpleDateFormat@a9427c06>
user=> (let [DateFormat "foo"] (DateFormat/getInstance))
(let [DateFormat "foo"] (DateFormat/getInstance))
#<SimpleDateFormat java.text.SimpleDateFormat@a9427c06>
(let [DateFormat "foo"] (. DateFormat getInstance))
#<SimpleDateFormat java.text.SimpleDateFormat@a9427c06>
user=> ((fn [DateFormat] (. DateFormat getInstance)) "foo")