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
$ go run main.go |
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
// Copyright 2013 The Go-SQLite Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package sqlite3 | |
/* | |
#include "sqlite3.h" | |
*/ | |
import "C" |
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 ( | |
"io" | |
"log" | |
"net/http" | |
"time" | |
"github.com/braintree/manners" | |
"github.com/xlab/closer" |
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
.PHONY: all clean cover cpu editor internalError later mem nuke todo | |
grep=--include=*.go --include=*.l --include=*.y | |
all: editor | |
go vet | |
golint | |
make todo | |
clean: |
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
1. Founder has all permissions. | |
2. Everyone in the chatroom can verify that public key X is indeed founder's key, it's a property of the chatroom and no peer stores it i.e. the chatroom itself contains that information somewhere, presumably in its ID (we don't rely on chatroom peers storing that data because they can came up with whatever they want i.e. say that the key X is not founder's key; we want that verification to be 100% exact and to work with even 1 peer in the chatroom). | |
3. To give permissions to user A, founder gives user A data which tells what permission level does A have (if we are going to have permission levels in tox at all). The data is signed by founder's private key. | |
4. Now A can show anyone that signed by founder data from the step (3) as a proof of her having permissions (anyone can verify that it was indeed signed by founder by (2)), so A can exercise her rights over everyone in the chatroom. | |
5. If A gives permissions to B, 1) A sends her founder-signed data to B to show that she i |
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
// Glow automatically generated OpenGL binding: http://github.com/go-gl/glow | |
package gl | |
import ( | |
"C" | |
"fmt" | |
"log" | |
"reflect" | |
"strings" |
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
static uint32_t friends_list_save(const Messenger *m, uint8_t *data) | |
{ | |
uint32_t i; | |
uint32_t num = 0; | |
for (i = 0; i < m->numfriends; i++) { | |
if (m->friendlist[i].status > 0) { | |
struct SAVED_FRIEND temp; | |
memset(&temp, 0, sizeof(struct SAVED_FRIEND)); | |
temp.status = m->friendlist[i].status; |
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
memstats := cmd.Flag.Lookup("memstats").Value.String() | |
if memstats != "" { | |
interval := cmd.Flag.Lookup("meminterval").Value.Get().(time.Duration) | |
context.fileMemStats, err = os.Create(memstats) | |
if err != nil { | |
return err | |
} | |
context.fileMemStats.WriteString("# Time\tHeapSys\tHeapAlloc\tHeapIdle\tHeapReleased\n") |
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
Testcase from https://github.com/skarademir/naturalsort/blob/master/naturalsort_test.go | |
BenchmarkNaturalSort 50000 28738 ns/op | |
BenchmarkHandySort 3000000 517 ns/op | |
A real battle-case from https://github.com/xlab/handysort/blob/master/strings_test.go | |
(10000 random alphanumeric strings) | |
BenchmarkStringSort 500 2665145 ns/op | |
BenchmarkHandyStringSort 100 11817051 ns/op | |
BenchmarkNaturalStringSort 1 1013808894 ns/op |
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
FROM progrium/busybox | |
ADD https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt /etc/ssl/ca-bundle.pem |