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.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace Move.Platform.TeamCityBranchUpdaterTool | |
{ | |
public static class Program | |
{ |
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; | |
using System.IO; | |
using System.Reflection; | |
using System.Text; | |
namespace test | |
{ | |
public class Mux<T> : DynamicObject |
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
// cons :: a -> b -> (a -> b -> t) -> t | |
// cons a b = \x -> x a b | |
static Func<Func<TA, TB, dynamic>, dynamic> Cons<TA, TB>(TA a, TB b) | |
{ | |
return f=>f(a,b); | |
} | |
// NOTE: you can not write: | |
// static Func<Func<TA, TB, TC>, TC> Cons<TA, TB>(TA a, TB b) | |
// { |
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
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var content = $('#content'); | |
var input = $('#input'); | |
var status = $('#status'); | |
// my color assigned by the server | |
var myColor = false; |
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
(function() { | |
var mongodb = require('mongodb'); | |
var http = require('http'); | |
var url = require('url'); | |
var socketio = require('socket.io'); | |
var express = require('express'); | |
var passport = require('passport'); | |
var passport_google = require('passport-google').Strategy; | |
var host = "chammers01vd"; | |
var port = process.env.PORT || 3000; |
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.Net; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Server | |
{ | |
public static class Program |
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
static string ComputeSignature(string policyEncoded, string privateKey) | |
{ | |
using (var hmac = new HMACSHA1(Encoding.UTF8.GetBytes(privateKey), true)) | |
{ | |
return Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(policyEncoded))); | |
} | |
} |
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 policy = new JObject(); | |
policy["expiration"] = DateTime.UtcNow.AddMinutes(10).ToString("u").Replace(" ", "T"); | |
var cond = new JArray(); | |
policy["conditions"] = cond; | |
cond.Add(new JObject {{"bucket", Bucket}}); | |
cond.Add(new JObject {{"key", filename}}); | |
cond.Add(new JObject {{"acl", "public-read"}}); | |
cond.Add(new JObject {{"Content-Type", "image/jpeg"}}); | |
cond.Add(new JArray("content-length-range", 0, 1024*1024)); |
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 static byte[] GetMultipartFormData( | |
IDictionary<string, string> parameters, | |
string caName, | |
byte[] fileContents, | |
string boundary) | |
{ | |
var formDataStream = new MemoryStream(); | |
byte[] formData; | |
using(formDataStream) |
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
// do not write: | |
if (!expr) | |
{ | |
return false; | |
} | |
return true; | |
// instead of |
OlderNewer