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
# | |
# library part | |
# | |
defprotocol PerxistentProto do | |
def refresh o | |
def save! o | |
end | |
defmodule Perxistent do |
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
# Define 2 vectors | |
cars <- c(1, 3, 6, 4, 9) | |
trucks <- c(2, 5, 4, 5, 12) | |
# Graph cars using a y axis that ranges from 0 to 12 | |
plot(cars, type="o", col="blue", ylim=c(0,12)) | |
# Graph trucks with red dashed line and square points | |
lines(trucks, type="o", pch=22, lty=2, col="red") |
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
to_nearest = function(d,bounds) { | |
lapply(d,FUN=function(x){ | |
idx=which.min(abs(bounds-x)) | |
bounds[idx] | |
}) | |
} |
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
There's a problem with https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel/cli.ex#L327 | |
### with Erlang 17.1 | |
# /usr/local/bin/mix | |
No file named /usr/local/bin/mix | |
# ls -l /usr/local/bin/mix | |
lrwxr-xr-x 1 root wheel 21 Jun 29 11:52 /usr/local/bin/mix -> ../lib/elixir/bin/mix |
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.Plug.Mobile do | |
import Plug.Conn | |
def init(options), do: options | |
@default_layout "application" | |
def call(conn, opts) do | |
layout = case get_req_header(conn,"user-agent") do | |
[ua|_] -> | |
cond do |
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
<SOME_DN>=real user DN... | |
add-primgroup.ldif: | |
############################################ | |
dn: <SOME_DN> | |
changetype: modify | |
replace: primaryGroupID | |
primaryGroupID: 513 | |
############################################ |
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
Quiz for web developers: | |
What's this?! | |
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
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
// US klavesnice s ceskymi pismeny | |
// | |
// Uz nikdy trapeni s vimem, ceskymi znaky a nekonecnym prepinanim klavesnic ;) | |
// Idealni pro klavesnice s us popisem. | |
// | |
// Az na male vyjimky kompletne stejna klavesnice jako standardni us: | |
// | |
// rada 2-0 obsahuje ceske znaky stejne jako na cz klavesnici | |
// s shiftem specialni znaky jako na us klavesnici | |
// s pravym altem cisla |
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
#! py | |
import os.path | |
def run(): | |
files = {} | |
pillar_root = __opts__['pillar_roots'][__env__][0] | |
priv_root = '%s/_priv/%s'%(pillar_root,__opts__['id']) | |
for dirname, dirnames, fnames in os.walk(priv_root): | |
for fname in fnames: |
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 Exlog do | |
defmacro __using__ _opts do | |
quote do | |
import Exlog | |
end | |
end | |
def new do | |
{:ok,e} = :erlog.new | |
e |
OlderNewer