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
/* tslint:disable:no-eval */ | |
/* tslint:disable:no-shadowed-variable */ | |
/* tslint:disable:restrict-plus-operands */ | |
/** | |
* Provides a synchronous require implementation for development purposes. | |
* @author Roel van Uden | |
* @license MIT | |
*/ | |
let require = ((): {(id: string): any, detour?: (id: string, value: string | ((id: string) => any)) => void} => { |
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 class Account | |
{ | |
#region Abstract | |
private static string GenerateHash(string password, string salt, int iterations) | |
{ | |
using (var rfc2898DeriveBytes = new Rfc2898DeriveBytes(password, Convert.FromBase64String(salt), iterations)) | |
{ | |
return Convert.ToBase64String(rfc2898DeriveBytes.GetBytes(64)); | |
} |
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 abstract class DataController : Controller | |
{ | |
private IContext _context; | |
#region Constructor | |
protected DataController() | |
{ | |
_context = new Context(); | |
} |
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 class Context : IContext | |
{ | |
public readonly ServiceEntities _entities; | |
#region Constructor | |
public Context() | |
{ | |
_entities = new ServiceEntities(); | |
} |
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
@model MyViewModel | |
<div>My strong-typed name is @Model.Name</div> |
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 () { | |
TextFilterWidget.prototype.renderWidget = (function(fn) { | |
return function() { | |
this.value.filterType = '2'; | |
fn.call(this); | |
}; | |
})(TextFilterWidget.prototype.renderWidget); | |
})(); |
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; | |
using System.Reflection; | |
namespace reflectos { | |
// interface to implement a command | |
interface ICommand { | |
void Run(); | |
} |
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; | |
using System.Reflection; | |
namespace reflectos { | |
// interface to implement a command | |
interface ICommand { | |
string Name { get; } | |
void Run(); | |
} |
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 HtmlAgilityPack; | |
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading.Tasks; | |
namespace Crawl { | |
class Crawlie { | |
private HashSet<string> _crawled; | |
private List<string> _matches; |
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 byte[] Delta() { | |
// Make a snapshot of the pixels in RGBA format. | |
byte[] Snapshot = _Capturer.Snapshot(); | |
// Check if the previous snapshot is invalid. | |
if (_PreviousSnapshot != null) { | |
// Initialize a new instance of the MemoryStream class. | |
using (MemoryStream MemoryStream = new MemoryStream()) { | |
using (var zipper = new GZipStream(MemoryStream, CompressionLevel.Fastest)) { | |
// Initialize a new instance of the BinaryWriter class. | |
using (BinaryWriter BinaryWriter = new BinaryWriter(zipper)) { |