Skip to content

Instantly share code, notes, and snippets.

@tucnak
tucnak / build.log
Created May 5, 2015 17:08
Qt 5.4.1, OS X 10.10.3
In file included from ../src/widget/form/profileform.cpp:17:
../../qtox/src/core/core.h:236:62: error: unknown type name 'TOX_MESSAGE_TYPE'
static void onFriendMessage(Tox* tox, uint32_t friendId, TOX_MESSAGE_TYPE type,
^
../../qtox/src/core/core.h:243:66: error: unknown type name 'TOX_USER_STATUS'; did you mean 'TOX_USERSTATUS'?
static void onUserStatusChanged(Tox* tox, uint32_t friendId, TOX_USER_STATUS userstatus, void* core);
^~~~~~~~~~~~~~~
TOX_USERSTATUS
../libs/include/tox/tox.h:78:1: note: 'TOX_USERSTATUS' declared here
TOX_USERSTATUS;
@tucnak
tucnak / child.tpl
Last active August 29, 2015 14:21
Whiskey child tpl demo
<% parent "base.html" %>
<% begin head %>
<% begin title %>(<% (alert_count) %>) Home / Sitename<% end title %>
<% end head %>
<% begin head %>
<h1>Hello, <% (name) %></h1>
<% end head %>
@tucnak
tucnak / gist:77c6d21d299f3c73ee7e
Created July 12, 2015 15:24
Unable to build Go1.5beta1 from Git on OSX 10.10.4
[tucnak@atlantis:src]$ go version
go version go1.4.2 darwin/amd64
[tucnak@atlantis:src]$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
@tucnak
tucnak / slices.go
Created October 28, 2015 08:56
Meet the Slice!
// Some numbers, please!
numbers := []int{1, 2, 3, 4, 5}
log(numbers) // 1. [1 2 3 4 5]
log(numbers[2:]) // 2. [3 4 5]
log(numbers[1:3]) // 3. [2 3]
// Fun fact: you can’t use negative indices!
//
// numbers[:-1] from Python won’t work. Instead,
@tucnak
tucnak / shadowing.go
Created October 28, 2015 09:24
I am really into variable shadowing in Go!
package main
import "fmt"
func Secret() (int, error) {
return 42, nil
}
func main() {
number := 0
@tucnak
tucnak / interface-slice.go
Created October 28, 2015 09:47
First-class support of interface slices!
package main
import (
"fmt"
"strconv"
)
type FancyInt int
func (x FancyInt) String() string {
@tucnak
tucnak / range-by-reference.go
Created October 28, 2015 10:09
Range by reference? Haha.
package main
import "fmt"
func main() {
numbers := []int{0, 1, 2, 3, 4}
for _, number := range numbers {
number++
}
diff --git a/application.go b/application.go
index 3bf7d8f..6226dd2 100644
--- a/application.go
+++ b/application.go
@@ -3,7 +3,6 @@ package climax
import (
"fmt"
"os"
- "strings"
)
package main
import (
"github.com/tucnak/climax"
)
func plain(group, name, brief string) *climax.Command {
return &climax.Command{
Name: name,
Brief: brief,
@tucnak
tucnak / signals.upd
Created November 16, 2015 22:55
Signal-slot concept in an imaginary Upd programming language
package stuff
import {
"fmt"
"github.com/tucnak/pipes" // пасхалка
}
class A {
slots: