This file contains hidden or 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
module Lexer | |
open System | |
open System.IO | |
open System.Text.RegularExpressions | |
type Register = | |
| A // 8 bits | |
| B // 8 bits | |
| D // 16 bits (A + B) |
This file contains hidden or 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.Threading.Tasks; | |
namespace AsyncAwaitTest { | |
class Program { | |
async static void DoIt() { | |
Console.WriteLine("Enter DoIt!"); | |
await Task.Delay(2000); | |
Console.WriteLine("DoIt has ended!"); |
This file contains hidden or 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; | |
namespace KobInjector { | |
/// <summary> | |
/// Simple Exeption to be thrown if a paramter cannot be resolved, it displays the whole injection stack | |
/// </summary> | |
public class InjectionStackException : Exception { |
This file contains hidden or 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
public static class ExtensionMethods { | |
public static string ToUnderscoreCase(this string str) { | |
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower(); | |
} | |
} |
This file contains hidden or 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 url = 'http://cert.europa.eu/cert/filteredition/en/CERT-LatestNews.html?&printpreview=all'; | |
var querySelector = 'a'; // All 'a' HTML elements (could be any selector) | |
var page = require('webpage').create(); | |
page.open(url, function (status) { | |
if(status === 'fail') { | |
console.log("ERROR"); | |
} else { |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Imported Rule 1" stopProcessing="true"> | |
<match url="^(.*)$" ignoreCase="false" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> | |
</conditions> |
This file contains hidden or 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.Linq; | |
namespace GroupbyTimespan { | |
class Program { | |
static void Main(string[] args) { | |
DateTime[] dateTimes = new[]{ | |
new DateTime(2010, 8, 24, 0, 5, 0), | |
new DateTime(2010, 8, 24, 0, 10, 0), |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body{ | |
background-color: #333; | |
text-align: center; | |
font-family: Helvetica; | |
color: #999; | |
} |
This file contains hidden or 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 brainLuck(code, input){ | |
function matchingBracket(code, instPtr){ | |
var count = 1; | |
while(count > 0){ | |
var c = code[++instPtr]; | |
if(c === '[') count++; | |
else if(c === ']') count--; | |
} | |
return instPtr; |
This file contains hidden or 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 DI = function (dependency) { | |
this.dependency = dependency; | |
}; | |
// Should return new function with resolved dependencies | |
DI.prototype.inject = function (func) { | |
var startIdx = func.toString().indexOf('('); | |
var endIdx = func.toString().indexOf('{'); | |
var paramsRaw = func.toString().substr(startIdx, endIdx - startIdx).trim(); | |
var params = paramsRaw.substr(1, paramsRaw.length -2).replace(/ /g, '').split(','); |