Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
This file contains hidden or 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
| /** | |
| * Parse query string. | |
| * ?a=b&c=d to {a: b, c: d} | |
| * @param {String} (option) queryString | |
| * @return {Object} query params | |
| */ | |
| getQueryParams: function(queryString) { | |
| var query = (queryString || window.location.search).substring(1); // delete ? | |
| if (!query) { | |
| return false; |
This file contains hidden or 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
| package main | |
| import ( | |
| "code.google.com/p/go.net/websocket" | |
| //"github.com/garyburd/go-websocket/websocket" | |
| //"github.com/zhangpeihao/gowebsocket" | |
| "net/http" | |
| "net/rpc" | |
| "net/rpc/jsonrpc" | |
| ) |
This file contains hidden or 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
| // requestAnimationFrame implementation as a custom function to allow blacklisting | |
| // devices with broken implementation. Currently needs timer-based fallbacks for iOS 6.x for | |
| // code running inside <iframe> elements. | |
| // Uses polyfills based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| (function() { | |
| var blacklisted = /iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent), | |
| lastTime = 0, | |
| nativeRequest = window.requestAnimationFrame || null, | |
| nativeCancel = window.cancelAnimationFrame || null; |
This file contains hidden or 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
| package fakeresponse | |
| import ( | |
| "testing" | |
| "net/http" | |
| ) | |
| type FakeResponse struct { | |
| t *testing.T | |
| headers http.Header |
This file contains hidden or 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
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |
This file contains hidden or 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
| /*jslint node: true */ | |
| "use strict"; | |
| var express = require("express"), | |
| consolidate = require("consolidate"), | |
| Handlebars = require("handlebars"), | |
| fs = require("fs"); | |
| var app = express(); |
This file contains hidden or 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
| /* | |
| modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview | |
| */ | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Promises |
This file contains hidden or 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
| // https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
| package main | |
| import ( | |
| "fmt" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| const privateKey = `content of id_rsa` |