Skip to content

Instantly share code, notes, and snippets.

View ahmetabdi's full-sized avatar
:shipit:

Ahmet ahmetabdi

:shipit:
View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="EFTTarget" xsi:type="EFTTarget" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="EFTTarget" />
package main
import (
"fmt"
"sort"
"github.com/nlopes/slack"
)
func rankByWordCount(wordFrequencies map[string]int) PairList {
"Elixir rocks" |> String.upcase() |> String.split()
=> ["ELIXIR", "ROCKS"]
@spec <method name>(<type of parameter>) :: <type of return value>
defmodule Bob do
@spec say(String.t()) :: String.t()
def say(message) do
"Bob says: #{message}"
end
end
class Talker
 def say_hello(name)
   return “Please give me a name” if name.nil?
   “Hi, #{name}.”
 end
end
defmodule Talker do
 def say_hello(nil), do: "Please give me a name"
 def say_hello(name) do
   "Hi, #{name}."
 end
end
Talker.say_hello(“Bob”) => “Hello, Bob!”
Talker.say_hello(“Jane”) => “Hi there, Jane!”
Talker.say_hello(“Ahmet”) => “Hi, Ahmet.”
defmodule Talker do
  def say_hello("Bob"), do: "Hello, Bob!"
  def say_hello("Jane"), do: "Hi there, Jane!"
  def say_hello(name) do
   "Hi, #{name}."
  end
end