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
class AsyncEventEmitter | |
constructor : () -> | |
@_dict = {} | |
emit : (eventName, args...) -> | |
if @_dict[eventName]? | |
(process.nextTick () -> | |
callback.apply null, args) for callback in @_dict[eventName] | |
once : (eventName, callback) -> |
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
var MAX = 1E8; | |
function out(i, final, res) { | |
res.end(i + "+1 " + MAX + " times = " + final + "\n"); | |
} | |
var inc_sync = function (i, callback) { | |
var k = 0, x = i; | |
for(var k = 0; k < MAX; k++) | |
x += 1; | |
callback(i, x); |
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
... | |
private object FormatObject(object value) | |
{ | |
if (this.ControlAtDesignTime()) | |
return value; | |
System.Type propertyType = this.propInfo.PropertyType; | |
if (this.formattingEnabled) | |
{ | |
ConvertEventArgs cevent = new ConvertEventArgs(value, propertyType); |
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
let SessionLoad = 1 | |
if &cp | set nocp | endif | |
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 | |
let v:this_session=expand("<sfile>:p") | |
silent only | |
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' | |
let s:wipebuf = bufnr('%') | |
endif | |
set shortmess=aoO | |
badd +2 C:\temp\file1.txt |
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 FluentAssertions; | |
using NUnit.Framework; | |
using Omu.ValueInjecter; | |
namespace ValueInjecter.Injecters | |
{ | |
[TestFixture] | |
public class PrefixInjectionTests | |
{ | |
private MySource _source; |
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
#SingleInstance force | |
; Revert mouse direction | |
#MaxHotkeysPerInterval 400 | |
WheelDown::WheelUp | |
WheelUp::WheelDown | |
; Remap capslock to control | |
Capslock::Ctrl | |
; Alternative - get a Win key back | |
; Capslock::Win |
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
void Main() | |
{ | |
var co = new Company { Id = 1, Name = "Moof Inc." }; | |
var clarus = new Contact { Id = 1, Name = "Clarus" }; | |
var mark = new Contact { Id = 2, Name = "Mark" }; | |
co.AddContact(clarus); | |
co.AddContact(mark); | |
co.MainContact = clarus; | |
// Attempt #1: Straight up, no converter |
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
// with <div id="grid"></div> | |
var sourceData = [ | |
{ Position: 'One', Simple: 'foo', Complex: { Login: 'foo', Description: 'foo - Foo Frye' } }, | |
{ Position: 'Two', Simple: 'bar', Complex: { Login: 'bar', Description: 'bar - Bar River' } }, | |
{ Position: 'Three', Simple: 'bar', Complex: { Login: 'bar', Description: 'bar - Bar River' } }, | |
{ Position: 'Four', Simple: 'baz', Complex: { Login: 'baz', Description: 'baz - Jayne Baz' } }, | |
]; | |
var nameList = [ |
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
-- Set this script as the script to run when a DVD is inserted into the player | |
property choiceButtons : {"Cancel", "Now", "Later"} | |
property defaultButton : "Later" | |
property giveUpAfter : 30 | |
property player : "VLC" | |
-- property player:"DVD Player" -- the built-in DVD player | |
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
#!/usr/bin/ruby | |
part1 = | |
["Temporary", "Intermittant", "Partial", "Redundant", "Total", "Multiplexed", | |
"Inherent", "Duplicated", "Dual-Homed", "Synchronous", "Bidirectional", | |
"Serial", "Asynchronous", "Multiple", "Replicated", "Non-Replicated", | |
"Unregistered", "Non-Specific", "Generic", "Migrated", "Localised", | |
"Resignalled", "Dereferenced", "Nullified", "Aborted", "Serious", "Minor", | |
"Major", "Extraneous", "Illegal", "Insufficient", "Viral", "Unsupported", | |
"Outmoded", "Legacy", "Permanent", "Invalid", "Deprecated", "Virtual", | |
"Unreportable", "Undetermined", "Undiagnosable", "Unfiltered", "Static", |