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
| (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
| 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
| #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
| #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
| 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
| package main | |
| import "fmt" | |
| type ( | |
| tF func(int) int | |
| tRF func(tF) tF | |
| tX func(tX) tF | |
| ) |
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/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <[email protected]> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
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
| function toon { | |
| echo -n "λ>" | |
| } | |
| get_git_dirty() { | |
| git diff --quiet || echo '*' | |
| } | |
| autoload -Uz vcs_info | |
| zstyle ':vcs_info:*' check-for-changes true |
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/bash | |
| ARGSI="${#}" | |
| if [ $ARGSI == "1" ]; then | |
| git add -A && git commit -m "$1" && git push origin master | |
| else | |
| if [ $ARGSI == "2" ]; then | |
| git add -A && git commit -m "$1" && git push origin $2 | |
| else | |
| if [ $ARGSI == "3" ]; then |