openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
package main | |
// using asymmetric crypto/RSA keys | |
import ( | |
"crypto/rsa" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"os" |
package main | |
import ( | |
"log" | |
"runtime" | |
) | |
// Reference: http://stackoverflow.com/questions/19847594/how-to-reliably-detect-os-platform-in-go | |
func main() { | |
log.Printf("%v\n", runtime.GOOS) // output windows or linux |
<html> | |
<head> | |
<script src="/static/jqwidgets-ver4.1.2/scripts/jquery-2.2.4.min.js"></script> | |
<script> | |
$( document ).ready(function() { | |
var token = ""; | |
// Global AJAX Configuration | |
$.ajaxSetup({ | |
type: 'post', |
/// <summary> | |
/// AskAlert expects a return value of AlertResult.YES or AlertResult.NO | |
/// </summary> | |
public override AlertResult AskAlert(SimplyMessage message) | |
{ | |
Console.WriteLine(message.Message); | |
if ((new Regex(@"^You did not enter an amount on the invoice")).Match(message.Message).Success) | |
{ | |
return AlertResult.YES; |
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) { | |
outputFilename := generateFilename("mp4") | |
// Actually start the command. | |
cmd := exec.Command("ffmpeg", | |
// Read input from stdin. | |
"-i", "-", | |
// ... environment-specific ffmpeg options ... | |
"-y", outputFilename) |
// Copyright 2013 René Kistl. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package srpc | |
import ( | |
"errors" | |
"fmt" | |
"github.com/pcdummy/skynet2/rpc/bsonrpc" |