This file contains hidden or 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 My do | |
defmacro ifx(conds, [do: code1, else: code2]) do | |
quote do | |
case unquote conds do | |
true -> unquote code1 | |
_ -> unquote code2 | |
end | |
end | |
end | |
end |
This file contains hidden or 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
#creating | |
{:ok, pid} = Agent.start_link(fn -> [] end) | |
#getting state | |
Agent.get(pid, fn(arr) -> arr end) | |
#updating state | |
Agent.get(pid, fn(arr) -> [1 | arr] end) |
This file contains hidden or 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
#Add the library to your dependencies | |
def deps do | |
[{:mutant, "~> 0.0.2"}] | |
end | |
#create a module and use the Mutant module passing the fields | |
defmodule MyMutant do | |
use Mutant, name: "" | |
end |
This file contains hidden or 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
atom.commands.add 'atom-text-editor', | |
'custom:insert-pipe': (event) -> | |
editor = @getModel() | |
editor.insertText('|>') |
This file contains hidden or 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
(defadvice switch-to-buffer (before save-buffer-now activate) | |
(when buffer-file-name (save-buffer))) | |
(defadvice other-window (before other-window-now activate) | |
(when buffer-file-name (save-buffer))) | |
(server-start) |
This file contains hidden or 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 models | |
import ( | |
"time" | |
"github.com/mrkaspa/geoserver/utils" | |
"gopkg.in/mgo.v2/bson" | |
) | |
type Persistance interface { |
This file contains hidden or 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 models | |
import ( | |
"fmt" | |
. "github.com/onsi/ginkgo" | |
. "github.com/onsi/gomega" | |
"gopkg.in/mgo.v2/bson" | |
) |
This file contains hidden or 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 models | |
type mockPersistor struct { | |
} | |
func NewMockPersistor() Persistance { | |
return mockPersistor{} | |
} | |
func (p mockPersistor) PersistAndFind(sn StrokeNear) ([]Stroke, error) { |
This file contains hidden or 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
/* | |
* This project is intended to be used as an acceptance test *and* a | |
* documentation example. If you change this file, please be sure that it | |
* renders appropriately in the generated documentation | |
*/ | |
buildscript { | |
repositories { jcenter() } | |
dependencies { | |
/* here to make sure that our dependencies get loaded in properly under |
This file contains hidden or 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
#!/bin/sh | |
# credo checks before commit | |
mix credo | |
CREDO_RES=$? | |
if [ $CREDO_RES -ne 0 ] | |
then | |
exit $CREDO_RES | |
fi |