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
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
(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
$(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
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
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
# this can be put in [repo]/.git/config for local settings | |
# or ~/.gitconfig for global settings | |
# create a difftool "nodiff" that just returns true | |
# this path is for Mac. On linux it's /bin/true i guess | |
[diff "nodiff"] | |
command = /usr/bin/true | |
# make git ignore white space differences, many different possibilites here |
NewerOlder