Skip to content

Instantly share code, notes, and snippets.

func mail(msg ...interface{}) {
str := "Subject: " + Config.GMail.Subject + "\r\n\r\n" + fmt.Sprint(msg)
smtp.SendMail("smtp.gmail.com:587",
smtp.PlainAuth("", Config.GMail.User, Config.GMail.Password, "smtp.gmail.com"),
Config.GMail.From,
[]string{Config.GMail.To},
[]byte(str))
}
=== RUN TestSimple
*wsevents_test.SimpleHandler has 4 methods
reflect.Method{Name:"OnClose", PkgPath:"", Type:(*reflect.commonType)(0x161020), Func:reflect.Value{typ:(*reflect.commonType)(0x161020), val:(unsafe.Pointer)(0x26b02), flag:0x130}, Index:0}
reflect.Method{Name:"OnError", PkgPath:"", Type:(*reflect.commonType)(0x161020), Func:reflect.Value{typ:(*reflect.commonType)(0x161020), val:(unsafe.Pointer)(0x26a76), flag:0x130}, Index:1}
reflect.Method{Name:"OnOpen", PkgPath:"", Type:(*reflect.commonType)(0x160fa8), Func:reflect.Value{typ:(*reflect.commonType)(0x160fa8), val:(unsafe.Pointer)(0x26a55), flag:0x130}, Index:2}
reflect.Method{Name:"OnTestMsg", PkgPath:"", Type:(*reflect.commonType)(0x161098), Func:reflect.Value{typ:(*reflect.commonType)(0x161098), val:(unsafe.Pointer)(0x26b8e), flag:0x130}, Index:3}
read
selecting
firing wsevents.jsonObj{"name":"testmsg", "args":[]interface {}{"test 123![]{}@"}}
before msg send
SIGQUIT: quit
pc: 0x9e09a
syscall.Syscall6()
/Users/jamesgray/go/src/pkg/syscall/asm_darwin_amd64.s:48 +0x30
syscall.kevent(0x6, 0x0, 0x0, 0xf8400bb008, 0xf80000000a, ...)
/Users/jamesgray/go/src/pkg/syscall/zsyscall_darwin_amd64.go:199 +0x88
syscall.Kevent(0xf800000006, 0x0, 0x0, 0xf8400bb008, 0xa0000000a, ...)
/Users/jamesgray/go/src/pkg/syscall/syscall_bsd.go:538 +0xa4
net.(*pollster).WaitFD(0xf8400bb000, 0xf8400a68c0, 0x0, 0x0, 0x0, ...)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics.PackedVector;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
package main
import "fmt"
import "unsafe"
func FastInvSqrt(x float32) float32 {
xhalf := float32(0.5) * x
i := *(*int32)(unsafe.Pointer(&x))
i = int32(0x5f3759df) - int32(i>>1)
x = *(*float32)(unsafe.Pointer(&i))
package main
// void nothing() {}
import "C"
import "fmt"
import "testing"
func nothing() {}
func CNothing(b *testing.B) {
#include "stdio.h"
#include "string.h"
void InsertHtmlSpace(char *inout, unsigned int len)
{
unsigned int spaces = 0;
unsigned int i, o;
for (i = 0; i < len; i++)
{
EXPLAIN ANALYZE
SELECT appid, max(time) AS maxtime FROM game_players
WHERE
appid != 0 AND time < date_trunc('hour', CURRENT_TIMESTAMP)
GROUP BY appid;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
HashAggregate (cost=488892.89..488930.88 rows=3799 width=12) (actual time=11097.638..11098.185 rows=3855 loops=1)
P2P NAT-holepunching Hub
Each peer is addressable by a public key in the network, essentially by DHT, but
in such a way that keeps the device's IP pseudo-anonymous, where an
ipaddr-publickey pair only suggests knowledge of the peer. This has a name, but
I cannot recall or seem to search the right keywords for it.
I don't fully understand NAT holepunching, so this may not be adequate. As I
understand it, and to put it simply, a mutually known middleman out on the
internet is used to relay your public address to another peer. But, your
package main
import (
"fmt"
glfw "github.com/go-gl/glfw3"
)
func errorCallback(err glfw.ErrorCode, desc string) {
fmt.Printf("%v: %v\n", err, desc)
}