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.Dynamic; | |
namespace DynamicTest | |
{ | |
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
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Reactive.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Rx_Test |
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; | |
using System.Net; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Security.Principal; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web; |
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
ko.bindingHandlers.sortableList = { | |
init: function (element, valueAccessor, allBindings) { | |
var items = allBindings.get('items') || 'li'; | |
var update = allBindings.get('update') || 'Index'; | |
var disable = allBindings.get('disable') || false; | |
$(element).sortable({ | |
items: items, | |
update: function ($e, $ui) { | |
$ui.item.parent().children(items).each(function (k, v) { |
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
$.ajaxSetup({ | |
beforeSend: function (jqXHR, settings) { | |
var types = ['DELETE', 'HEAD', 'PUT']; | |
if ($.inArray(settings.type, types) !== -1) { | |
jqXHR.setRequestHeader('X-HTTP-Method-Override', settings.type); | |
settings.type = 'POST'; | |
} | |
} | |
}); |
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/local/bin/python | |
import RPi.GPIO as GPIO | |
class RotaryEncoder: | |
DIRECTION_CLOCKWISE = 1 | |
DIRECTION_COUNTERCLOCKWISE = 3 | |
prv_seq = 0 |
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.Blob; | |
using System; | |
using System.IO; | |
using System.Net.Mime; | |
using System.Threading.Tasks; | |
namespace N3rd.Storage | |
{ | |
public interface IStorageProvider |
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.Linq; | |
using System.Security.Claims; | |
using System.Text; | |
using System.Threading; | |
using System.Web; | |
namespace HttpAuthModule | |
{ | |
public class HttpAuthModule : IHttpModule |
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.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
internal static class IQueryableExtensions | |
{ | |
public static IQueryable<T> OrderBy<T>(this IQueryable<T> source, string ordering) | |
{ | |
return source.OrderBy(ordering, "OrderBy"); |
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
public static string Base10ToBase64Url(ulong base10) | |
{ | |
char[] base64url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".ToCharArray(); | |
var res = new List<char>(); | |
for (ulong remainder = base10, mod = remainder % 64; remainder > 0; remainder = remainder / 64, mod = remainder % 64) | |
{ | |
res.Add(base64url[mod]); | |
} | |
res.Reverse(); | |
return new String(res.ToArray()); |
OlderNewer