Skip to content

Instantly share code, notes, and snippets.

View fatih's full-sized avatar

Fatih Arslan fatih

View GitHub Profile
@fatih
fatih / Default (OSX).sublime-keymap
Created February 19, 2013 07:46
Vintage key bindings
[
{ "keys": ["ctrl+shift+r"], "command": "expand_selection_to_paragraph" },
{ "keys": ["ctrl+u"], "command": "scroll_lines", "args": {"amount": 30.0}, "context": [{ "key": "setting.command_mode" }]},
{ "keys": ["ctrl+d"], "command": "scroll_lines", "args": {"amount": -30.0}, "context": [{"key": "setting.command_mode"}]},
{ "keys": ["j", "k"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
@fatih
fatih / Preferences.sublime-settings
Created February 19, 2013 07:47
Sublime settings
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"find_selected_text": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".build"
@fatih
fatih / zmq_client.go
Created May 16, 2013 23:18
Start in order go run zmq_device.go go run zmq_server.go go run zmq_client.go
package main
import (
"fmt"
zmq "github.com/alecthomas/gozmq"
)
func main() {
context, _ := zmq.NewContext()
socket, _ := context.NewSocket(zmq.REQ)
@fatih
fatih / rr.py
Created May 18, 2013 00:00 — forked from minrk/rr.py
import os
import sys
import threading
import zmq
def worker(identity, wurl):
ctx = zmq.Context.instance()
s = ctx.socket(zmq.REP)
s.identity = identity
@fatih
fatih / gist:5764501
Created June 12, 2013 11:24
Example document (mongodb)
{
"_id" : ObjectId("51b8582110b7fc5960000001"),
"docname" : "foo",
"entries" : {
"example-123" : {
"enabled" : true,
"mode" : "bar",
"entryname" : "example-123"
}
}
@fatih
fatih / zmq-ROUTER-ROUTER.go
Last active December 19, 2015 19:38
Zmq ROUTER-ROUTER via zmq3 golang
package main
import (
"fmt"
zmq "github.com/pebbe/zmq3"
"log"
)
func main() {
var err error
@fatih
fatih / zmq-REQ-client.go
Created July 16, 2013 08:57
Zmq REQ Client
package main
import (
"fmt"
zmq "github.com/pebbe/zmq3"
"log"
)
func main() {
requester, _ := zmq.NewSocket(zmq.REQ)
@fatih
fatih / zmq-REP-client.go
Created July 16, 2013 09:03
Zmq REP client
package main
import (
zmq "github.com/pebbe/zmq3"
)
func main() {
responder, _ := zmq.NewSocket(zmq.REP)
defer responder.Close()
responder.SetIdentity("1123581321") //key to be used
@fatih
fatih / set.go
Created August 11, 2013 21:05
Concurrent safe SET data structure in Go (Golang)
// A very simple example about how to use concurrent-safe SETs (using string as keys) in GO
package main
import (
"fmt"
"sync"
)
type Set struct {
m map[string]bool
@fatih
fatih / attachTest.go
Last active December 26, 2015 22:29
Attach failing for arguments more than two
package main
import (
"fmt"
"github.com/caglar10ur/lxc"
)
func main() {
// first create and start
l := lxc.NewContainer("testing")