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 static org.apache.cassandra.utils.ByteBufferUtil.bytesToHex; | |
import static org.apache.cassandra.utils.ByteBufferUtil.hexToBytes; | |
import org.apache.cassandra.config.CFMetaData; | |
import org.apache.cassandra.config.ConfigurationException; | |
import org.apache.cassandra.config.DatabaseDescriptor; | |
import org.apache.cassandra.config.Schema; | |
import org.apache.cassandra.db.ColumnFamily; | |
import org.apache.cassandra.db.CounterColumn; | |
import org.apache.cassandra.db.DecoratedKey; |
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
[Unit] | |
Description=dnscrypt - Encrypted DNS service provided by OpenDNS | |
After=NetworkManager.service | |
[Service] | |
ExecStart=/usr/local/sbin/dnscrypt-proxy -u dnscrypt | |
ExecReload=/bin/kill -HUP $MAINPID | |
[Install] | |
WantedBy=basic.target |
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 Curry do | |
defmacro defcurry({func_name, _func_ctx, args}, do: body) do | |
num_args = Enum.count(args) | |
if num_args - 1 >= 1 do | |
new_args = Enum.take(args, num_args - 1) | |
quote do | |
def unquote(func_name)(unquote_splicing(args)) do | |
unquote(body) | |
end |
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 com.typesafe.config.Config | |
import scala.language.experimental.macros | |
import scala.reflect.macros.whitebox | |
import scala.reflect.runtime.universe._ | |
object TypesafeConfigMacros { | |
def asImpl[T: c.WeakTypeTag](c: whitebox.Context)(key: c.Expr[String])(tag: c.Expr[WeakTypeTag[T]]): c.Expr[Option[T]] = { |
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
-module(assignment). | |
-export([perimeter/1, area/1, enclose/1, bits/1]). | |
perimeter({circle, {_X, _Y}, R}) -> 2 * math:pi() * R; | |
perimeter({rectangle, {_X, _Y}, H, W}) -> 2 * (H + W); | |
%% A triangle is defined by its' three coordinates. | |
perimeter({triangle, {X1, Y1}, {X2, Y2}, {X3, Y3}}) -> | |
A = distance({X1, Y1}, {X2, Y2}), |
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
-module(index). | |
-export([do_index/1, show_file_contents/1]). | |
%% Main entrypoint | |
%% In the Erlang shell, execute: rp(index:do_index("path_to_file")). | |
%% Reads the contents of the file using the provided functions, builds up a map | |
%% of words to their locations, compresses the locations to ranges and returns a | |
%% list sorted in alphabetical order | |
do_index(Name) -> | |
Lines = get_file_contents(Name), |
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
package otgrpc | |
import ( | |
context "golang.org/x/net/context" | |
"github.com/opentracing/opentracing-go" | |
"github.com/opentracing/opentracing-go/ext" | |
"github.com/opentracing/opentracing-go/log" | |
"google.golang.org/grpc" | |
) |
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
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0,allocate/0,deallocate/1,stop/0]). |
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
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0,allocate/0,deallocate/1,stop/0,spawn_client/1]). |
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 BuildEnvPlugin.autoImport.BuildEnv | |
import com.sun.xml.internal.ws.api.config.management.policy.ManagementAssertion.Setting | |
import sbt.PluginTrigger.AllRequirements | |
import sbt.{AutoPlugin, Def, PluginTrigger, Plugins} | |
import sbtdocker.DockerPlugin | |
import sbt._ | |
import sbt.Keys._ | |
object BuildEnvPlugin extends AutoPlugin { | |
override def trigger: PluginTrigger = AllRequirements |
OlderNewer