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
#!groovy | |
def call() { | |
checkout([ | |
$class: 'GitSCM', | |
branches: scm.branches, | |
extensions: scm.extensions + [[$class: 'WipeWorkspace'], [$class: 'LocalBranch']], | |
userRemoteConfigs: scm.userRemoteConfigs | |
]) | |
} |
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
cmd = [ | |
'fpm', | |
'-t deb', | |
'-s dir', | |
'-d postgresql', | |
'-m ' + config[:maintainer], | |
"-n '#{config[:product]}'", | |
"--prefix /opt/puppet/#{config[:product]}", | |
'-v ' + deb_version, | |
"--deb-init #{config[:product]}.init", |
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
[<<"#ohaibot-testing">>]. | |
[<<"#elixirconf">>]. |
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
{:ok, connection} = AMQP.Connection.open | |
{:ok, channel} = AMQP.Channel.open(connection) | |
message = Enum.join(System.argv, " ") || "Hello World!" | |
AMQP.Exchange.declare(channel, "logs", :fanout) | |
AMQP.Basic.publish(channel, "logs", "", message) | |
IO.puts " [x] Sent '#{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
:application.ensure_all_started(:ssl) | |
{:ok, handle} = :eldap.open(['ldap.example.com'], [{:port, 636}, {:ssl, true}]) | |
authenticated = | |
:ok == :eldap.simple_bind(handle, | |
'uid=jeff,ou=users,dc=example,dc=com', | |
'notmyrealpassword') | |
{:ok, {:eldap_search_result, list_of_entries, _}} = |
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 X10 do | |
# all codes referenced from http://www.haibrain.com/informatie-domotica-x10-protocol-c-131_148_141.html?language=en | |
@house_codes %{ | |
6 => :house_a, | |
14 => :house_b, | |
2 => :house_c, | |
10 => :house_d, | |
1 => :house_e, | |
9 => :house_f, |
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 MyApp.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :my_app, | |
version: get_version, | |
elixir: "~> 1.0", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: Mix.compilers, | |
build_embedded: Mix.env == :prod, |
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
wrk.method = "POST" | |
-- this assumes that we're sending to a html form endpoint with csrf protection disabled | |
-- wrk.body and wrk.headers would be different if we were sending a JSON payload to a JSON API endpoing | |
wrk.body = "message[body]=wat" | |
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded" |
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 BasicBench do | |
use Benchfella | |
@num :random.uniform(999_999_999_999) | |
bench "interpolation" do | |
@num | |
|> NumToWordsString.say | |
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
1. Clustering | |
a. Interaction w/ running code without having code | |
b. Remote process spawning | |
c. std in/out redirect | |
2. Supervision Trees | |
3. Live Code Update |
NewerOlder