Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"time"
)
const height = 5
func main() {
package main
import (
"fmt"
"time"
)
func main() {
// marks := []rune{0x25F7, 0x25F6, 0x25F5, 0x25F4}
// marks := []rune{0x25CB, 0x25D4, 0x25D1, 0x25D5, 0x25CF, 0x25C9, 0x25CE}
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --pretty=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim yellow) - %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%C(reset)'
lg = !"git lg1"
co = checkout
ci = commit
stat = status
sync-master = "!git checkout master && git fetch upstream && git reset --hard upstream/master"
sync-branch = "!git fetch upstream && git merge upstream/master"
[push]
// This is a solution implemented in Go (golang.org) for the "lonely integer" problem
// as presented here:
//
// https://www.hackerrank.com/contests/master/challenges/lonely-integer
//
package main
import (
"bufio"
package main
import (
"fmt"
"strings"
)
// Global scope level
var scope = new(ScopeLevel)
package main
import (
"encoding/base64"
"fmt"
"log"
)
type MorseChar string
#!/usr/bin/env perl
use 5.010; # Required 5.10 or greater for 'Q' and 'q' in format string for pack/unpack
use warnings;
use strict;
use Config;
use Math::BigInt qw(:constant);
use Test::More tests => 4;
@caelifer
caelifer / errno.go
Created July 14, 2016 18:06
How to handle errno from Go program via cgo.
package main
import "unsafe"
/*
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
package main
import (
"fmt"
"math/rand"
)
func main() {
for i := 0; i < 4; i++ {
if i > 0 {
package main
import (
"fmt"
"strings"
)
func main() {
t1 := NewNode("A")
t2 := NewNode("B", t1)