Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
migueldeicaza / gist:8de4f89b182588927ba16f31b214e35a
Created September 25, 2016 14:17
Minimal HoloLens app with UrhoSharp.
using System;
using Windows.ApplicationModel.Core;
using Urho;
using Urho.Holographics;
using Urho.HoloLens;
internal class Program
{
[MTAThread]
private static void Main()
@migueldeicaza
migueldeicaza / gist:96c2bc52bfc30aa47a3ba34ce135e6f1
Last active September 12, 2016 14:00
Implicit string constant to byte[]/byte* conversions for C#
diff --git a/mcs/mcs/constant.cs b/mcs/mcs/constant.cs
old mode 100644
new mode 100755
index a0ae78c..0f45e74
--- a/mcs/mcs/constant.cs
+++ b/mcs/mcs/constant.cs
@@ -12,6 +12,7 @@
using System;
using System.Globalization;
@migueldeicaza
migueldeicaza / gist:630331ecb44dcec3aa815a7dca6eaeee
Created September 6, 2016 02:52
mcs tuple grammer changes
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
index bb2bd6e..a41ae23 100644
--- a/mcs/mcs/cs-parser.jay
+++ b/mcs/mcs/cs-parser.jay
@@ -3222,6 +3222,20 @@ type_expression
$$ = new ComposedCast ((ATypeNameExpression) $1, (ComposedTypeSpecifier) $2);
}
| builtin_type_expression
+ | tuple_type
+ ;
using Mono.CSharp;
class X {
static void Main ()
{
var a = new
Evaluator (new CompilerContext (new CompilerSettings (), new ConsoleReportPrinter ()));
a.Run ("System.Console.WriteLine (true);");
}
}
@migueldeicaza
migueldeicaza / gist:cd99938c2a4372e7e5d5
Created September 8, 2015 14:31
Probing for events having a single callback on .NET and Mono
const BindingFlags SEARCH_FLAGS = BindingFlags.NonPublic | BindingFlags.Instance;
var hasSingleTargetMethod = typeof(MulticastDelegate).GetMethod("InvocationListLogicallyNull", SEARCH_FLAGS) ??
typeof(MulticastDelegate).GetMethod("get_HasSingleTarget", SEARCH_FLAGS);
if (hasSingleTargetMethod != null)
HasSingleTarget = (HasSingleTargetFn)Delegate.CreateDelegate(typeof(HasSingleTargetFn), hasSingleTargetMethod, true);
else // gracefull degradation
HasSingleTarget = md => md.GetInvocationList().Length == 1;
// ...
@migueldeicaza
migueldeicaza / gist:ae2a3ebf289169d413dc
Created June 16, 2015 01:53
Add IsAbstract property
diff --git a/Clang/Ast/CXXRecordDecl.cs b/Clang/Ast/CXXRecordDecl.cs
index 6acc7b3..16f5453 100644
--- a/Clang/Ast/CXXRecordDecl.cs
+++ b/Clang/Ast/CXXRecordDecl.cs
@@ -19,6 +19,13 @@ namespace Clang.Ast
public extern bool IsDerivedFrom (CXXRecordDecl baseDecl);
[MethodImpl (MethodImplOptions.InternalCall)]
+ extern int GetAbstract ();
+
diff --git a/external/rx b/external/rx
--- a/external/rx
+++ b/external/rx
@@ -1 +1 @@
-Subproject commit 00c1aadf149334c694d2a5096983a84cf46221b8
+Subproject commit 00c1aadf149334c694d2a5096983a84cf46221b8-dirty
diff --git a/mcs/mcs/Makefile b/mcs/mcs/Makefile
index d2aa50e..8999939 100644
--- a/mcs/mcs/Makefile
+++ b/mcs/mcs/Makefile
### Keybase proof
I hereby claim:
* I am migueldeicaza on github.
* I am migueldeicaza (https://keybase.io/migueldeicaza) on keybase.
* I have a public key whose fingerprint is 161C 35A0 6E68 E3E4 C084 64F9 A0AB BD0B 56B7 D30A
To claim this, I am signing this object:
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
@migueldeicaza
migueldeicaza / gist:7594491
Last active December 29, 2015 01:39
For David Fowler
These instructions will get you Mono compiled from source.
Requirements:
Xcode installed
Command Line Tools installed (part of Xcode)
Then, create a text file with the contents of everything after "=====", save it as "build.sh" in your home directory
Open a terminal window, and type this in your shell: