This file contains 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
root@(none):~/debian-installer-20130613+deb7u1/build# fakeroot make rebuild_netboot | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LC_CTYPE = "UTF-8", | |
LANG = (unset) | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). | |
perl: warning: Setting locale failed. |
This file contains 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
import json | |
import os | |
import tornado.httpserver | |
import tornado.web | |
import tornado.websocket | |
import tornado.ioloop | |
import tornado.gen | |
import tornadoredis | |
This file contains 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
defmodule KVServer.Command do | |
@doc ~S""" | |
Parses a line into a command. | |
## Examples | |
iex> KVServer.Command.parse "CREATE shopping\r\n" | |
{:ok, {:create, "shopping"}} | |
iex> KVServer.Command.parse "CREATE shopping \r\n" |
This file contains 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
defmodule KVServer.Command do | |
@doc ~S""" | |
Parses a line into a command. | |
## Examples | |
iex> KVServer.Command.parse "CREATE shopping\r\n" | |
{:ok, {:create, "shopping"}} | |
""" | |
def parse(line) do |
This file contains 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
defmodule Action do | |
defmodule Configuration do | |
end | |
@callback description(Configuration) :: String | |
@callback perform(Configuration, String) :: nil | |
end | |
defmodule Webhook do | |
@behaviour Action |
This file contains 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
defmodule KV.Bucket do | |
@doc """ | |
Starts a new bucket. | |
""" | |
def start_link do | |
Agent.start_link(fn -> %{} end) | |
end | |
@doc """ | |
Gets a value from the `bucket` by `key`. |
This file contains 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
defmodule KV do | |
def start_link do | |
Task.start_link(fn -> loop(%{}) end) | |
end | |
defp loop(map) do | |
receive do | |
{:get, key, caller} -> | |
send caller, Map.get(map, key) | |
loop(map) |
This file contains 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
defmodule Math do | |
def zero_a?(0) do | |
true | |
end | |
def zero_a?(_) do | |
false | |
end | |
def zero_b?(x) do |
This file contains 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
class EventDispatcher: | |
def __init__(self, loop, input_handler, output_handler): | |
self.loop = loop | |
self.input_handler = input_handler | |
self.output_handler = output_handler | |
async def __call__(self, event): | |
# Generic stuff (logging, benchmarking, ...) | |
message = await self.input_handler(event) | |
await self.output_handler(message) |
This file contains 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
MATCH (root:RootObject), (u {name: 'Tom'})-[:HAS_PERMISSION]->(o), | |
p = shortestPath((root)-[*]-(o)) WHERE (r IN rels(p) WHERE type(r) = 'CONTAINS') | |
RETURN p |
NewerOlder