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 System; | |
using System.Collections.Generic; | |
namespace CompareTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
# Licensed under the MIT license. | |
# Copyright (C) 2017 Kristofer Liljeblad | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
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 Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Auth; | |
using System; | |
namespace AppendBlobSample | |
{ | |
class Program | |
{ | |
private static string StorageAccountName = "put-your-storage-account-name-here"; | |
private static string StorageAccountAccessKey = "put-your-storage-account-access-key-here"; |
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
// Prerequisites: | |
// npm install redis | |
var redis = require('redis'); | |
var client = redis.createClient(); | |
client.setex('fixedexpkey', 5, 'Foo'); | |
client.setex('slidingexpkey', 5, 'Bar'); | |
// Get value every second without using a sliding window expiration implementation |
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
namespace CSharp6 | |
{ | |
// What's New In C# 6.0? | |
// | |
// The following class and the implementation was created as a personal reference after | |
// watching Mads Torgersen's video. Most of this example is from him. | |
// | |
// - What's New In C# 6.0 (http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/116) | |
// | |
// Features |
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
// Pad number i left with c until n characters or more | |
// padLeft(1, 3); // '001' | |
// padLeft(12, 3); // '012' | |
// padLeft(1234, 3); // '1234' | |
// padLeft(1, 3, 'x'); // 'xx1' | |
function padLeft(i, n, c){ | |
return Array(n - String(i).length + 1).join(c||'0') + i; | |
} |
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 tessel = require('tessel'); | |
function blink(ledNo, noTimes, callback) { | |
if (noTimes > 0) { | |
var led = tessel.led[ledNo].output(0); | |
var lightOnDelay = 500; | |
var lightOffDelay = 1000; | |
console.log('blink - turning on led (%d)', noTimes); | |
led.write(true); |
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 http = require('http'); | |
function httpGetJSON(url, callback) { | |
http.get(url, function(res) { | |
var body = ''; | |
res.on('data', function(data) { | |
console.log('httpGetJSON - data received', data); | |
body += data; | |
}); |