I hereby claim:
- I am shankardevy on github.
- I am shankardevy (https://keybase.io/shankardevy) on keybase.
- I have a public key ASAdzhd70kj5FV72DJq15nV4-E6HEf9XNZ7kngbKCC6UIgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#include <Wire.h> | |
void setup() { | |
// put your setup code here, to run once: | |
Wire.begin(); // join i2c bus (address optional for master) | |
Serial.begin(9600); | |
} | |
int reading = 0; |
defmodule LearnMacro do | |
defmacro gen_func(func_name, arguments, do: expression) do | |
quote do | |
def unquote(:"#{func_name}")(unquote_splicing(arguments)), do: unquote(expression) | |
end | |
end | |
end |
defmodule Math do | |
def map_number(number) do | |
case { rem(number,3), rem(number,5) } do | |
{ 0, 0 } -> | |
"CradlePop" | |
{ 0, _ } -> | |
"Cradle" | |
{ _, 0 } -> | |
"Pop" | |
{ _, _ } -> |
defmodule Tamil do | |
defmacro கூட்டு(a + b) do | |
a + b | |
end | |
defmacro போடு(x) do | |
IO.puts x | |
end | |
end |
defmodule KV.Supervisor do | |
use Supervisor | |
def start_link do | |
Supervisor.start_link(__MODULE__, :ok) | |
end | |
@manager_name KV.EventManager | |
@registry_name KV.Registry |
defmodule Snapshot.Server do | |
@moduledoc """ | |
Provides functions and workers for getting snapshots from the camera | |
Workers are run in the background getting snapshots from the camera | |
using the frequency for the given camera. | |
Functions can be called from other places to get snapshots manually. | |
""" |
defmodule MyApp.Worker.Supervisor do | |
use Supervisor | |
def start_link do | |
Supervisor.start_link(__MODULE__, [], name: __MODULE__) | |
end | |
def init(_) do | |
Task.start_link(&MyApp.Worker.Supervisor.initiate_workers/0) |
# sinatra app | |
# config.ru | |
# To start the server, run | |
# $ rackup config.ru | |
# visit localhost:9292/digest | |
require 'sinatra/base' |
def fetch(url, {:basic, auth}) do | |
[username, password] = String.split(auth, ":") | |
request = HTTPotion.get(url, [basic_auth: {username, password}]) | |
request.body | |
end | |
def fetch(url, {:digest, auth}) do | |
digest_request = Porcelain.shell("curl --max-time 15 --digest --user '#{auth}' #{url}") | |
digest_request.out | |
end |