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
# Set Vi Mode | |
setw -g mode-keys vi | |
# Reload Config | |
bind-key R source-file "$HOME/.tmux_conf"\; display-message "Configuration Reloaded" | |
# Option+Arrow | |
bind-key -n M-Left previous-window | |
bind-key -n M-Right next-window |
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 JSON do | |
@moduledoc """ | |
This module is a wrapper for the Jiffy JSON library. | |
## Examples | |
JSON.encode({[{foo: bar, count: 1}]}) | |
JSON.encode({[{"foo": "bar", "count": 1}]}) | |
JSON.decode("\\"foo\\": \\"bar\\", \\"count\\": 1}]}) |
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 Chat.Client do | |
# In all of the following functions 'server' stands for the server's pid | |
def join({server, name}) do | |
send server, {name, :join, ""} | |
end | |
def say({server, name, message}) do | |
send server, {name, :say, message} | |
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
-module(date_util). | |
-compile(export_all). | |
epoch() -> | |
now_to_seconds(now()) | |
. | |
epoch_hires() -> | |
now_to_seconds_hires(now()) | |
. |
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
-module(dispatcher). | |
-export([dispatch/2]). | |
dispatch(_, []) -> none; | |
dispatch(Req, [{Regexp, Handler}|T]) -> | |
"/" ++ Path = Req:get(path), | |
Method = Req:get(method), | |
Match = re:run(Path, Regexp, [global, {capture, all_but_first, list}]), | |
case Match of | |
{match, [MatchList]} -> |
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
<?php | |
/** | |
* Modifying the final CP Output | |
* | |
* This extension demonstrates how you can access and modify the final ExpressionEngine | |
* CP output. It is not a hack, but it is a new technique that to my knowledge has not | |
* been used before in an EE addon. | |
* | |
* This has not been road tested and its side effects are unknown, so use this at your own risk. |
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
knife node configure my_node.example.com |
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
RewriteCond %{HTTPS} off | |
RewriteCond $1 ^(section|othersection) [NC] | |
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L] | |
RewriteCond %{HTTPS} on | |
RewriteCond $1 ^(anothersection|anothersection|anothersection) [NC] | |
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f |
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
<?php | |
class Person { | |
private $mixins = array(); | |
private $instances = array(); | |
public function __construct() | |
{ | |
if (func_num_args()) |
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
layout: | |
documentation.html | |
-- | |
title: | |
Page Custom Fields | |
-- | |
summary: | |
h2. Page Custom Fields |