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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public sealed class Container | |
{ | |
private Dictionary<Type, Type> concreteTypes = new Dictionary<Type, Type>(); | |
private Dictionary<Type, object> objects = new Dictionary<Type, object>(); |
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
protected override CreateParams CreateParams | |
{ | |
get | |
{ | |
CreateParams cp = base.CreateParams; | |
cp.ExStyle |= 0x02000000; | |
return cp; | |
} | |
} |
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
>> double: lambda [? * 2] | |
>> double 2 | |
== 4 | |
>> double: lambda [? + ?] | |
>> double 4 | |
== 8 | |
>> add2: lambda [?1 + ?2] | |
>> add2 2 4 |
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
Content = | |
(Element / Text)* | |
Element = | |
startTag:StartTag content:Content endTag:EndTag { | |
if (startTag != endTag) { | |
throw new Error( | |
"Expected </" + startTag + "> but </" + endTag + "> found." | |
); | |
} |
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
function objectMap () { | |
return Object.defineProperty(Object.create(null), Symbol.iterator, { | |
configurable: true, // This descriptor is inspired by Map.prototype[Symbol.iterator] | |
writable: true, | |
value: function* () { | |
for (const key in this) { | |
yield [key, this[key]] | |
} | |
} | |
}) |
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
program min_ogl; | |
uses | |
Windows, OpenGL; | |
var | |
pfd : TPixelFormatDescriptor; | |
DC : HDC; | |
begin | |
// Creating window |
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
<!-- modified from http://alex.dojotoolkit.org/08/jscript/lettable.html --> | |
<html> | |
<head> | |
<title>A Crazy Getter/Setter Hack</title> | |
</head> | |
<body> | |
<script language="VBScript" type="text/VBScript"> | |
Function exec_vb_global(code) | |
ExecuteGlobal(code) | |
End Function |
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
IMPORTANT | |
Please duplicate this radar for a Safari fix! | |
This will clean up a 50-line workaround. | |
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072) | |
////////////////////////////////////////////////////////////////////////////// | |
(Now available as a standalone repo.) |
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
/* | |
* Simple Intentation-Based Language PEG.js Grammar | |
* ================================================ | |
* | |
* Describes a simple indentation-based language. A program in this language is | |
* a possibly empty list of the following statements: | |
* | |
* * S (simple) | |
* | |
* Consists of the letter "S". |
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
<?PHP | |
/** | |
* Spintax - A helper class to process Spintax strings. | |
*/ | |
class Spintax | |
{ | |
/** | |
* Set seed to make the spinner predictable. | |
*/ |
OlderNewer