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 Foo do | |
def bar do | |
:bar | |
end | |
end | |
defmodule Weird do | |
@moduledoc """ | |
Illustrates a weird behavior I noticed which doesn't seem to make sense. |
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 WackyMacro do | |
defmacro defalias(alias_name, alias_path) do | |
quote bind_quoted: [alias_name: alias_name, alias_path: alias_path] do | |
defmacro unquote(:"get_#{alias_name}")(path) do | |
quote bind_quoted: [path: path, alias_path: alias_path] do | |
get(var!(assigns).render_meta.parsed, alias_path ++ path) | |
end | |
end | |
end | |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
### Keybase proof | |
I hereby claim: | |
* I am djthread on github. | |
* I am thread (https://keybase.io/thread) on keybase. | |
* I have a public key whose fingerprint is 13E7 DF84 0256 04AF 57D1 89B7 D237 5901 CCA1 144C | |
To claim this, I am signing this object: |
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
# without a class | |
thing = -> | |
thePrivate = -> console.log "I'm private" | |
thePublic: -> console.log "I'm public" | |
t = thing() | |
t.thePublic() | |
t.thePrivate() | |
# with one |
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
postSetupHandler = null | |
launch = (tmp) -> | |
postSetupHandler = tmp | |
log.log "" | |
log.log "PodProxy Starting..." | |
filesystem.readFile 'db/config.json', loadConfigFile | |
# We let these functions block since everything we do needs configuration and feeds | |
loadConfigFile = (err, data) -> |
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
loadConfigFile = (err, data) -> | |
log.log "Reading Global Config File..." | |
if err | |
log.log 'db/config.json not found. starting new one..' | |
else | |
for key, val of JSON.parse data | |
if config[key] != undefined then config[key] = val | |
log.log "Loaded." | |
log.log "" | |
filesystem.readFile 'db/feeds.json', loadFeedsFile |