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 %{HTTP_HOST} !^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] |
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 fib( $n ) { | |
// PRE: $n >= 0 | |
if( $n < 2 ) { | |
return $n; | |
} else { | |
return fib( $n-1 ) + fib( $n-2 ); | |
} | |
} | |
for( $i=0; $i<5000; $i++ ) { |
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
Parsing instructions from Boxfile | |
Executing deploy | |
> Building deployable template | |
> Init git submodules | |
> Init git submodules --recursive | |
> Init writable directories on storage cluster | |
> Mounting writable directories | |
> Finalizing image | |
> Building php web component environment | |
> Building php web component network |
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(baker_http_supervisor). | |
-include("baker.hrl"). | |
-export([start_link/0]). | |
start_link() -> | |
WorkerCount = | |
case os:getenv("HTTP_LISTENER_COUNT") of | |
false -> ?DEFAULT_HTTP_LISTENER_COUNT; |
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_shard(Master, Slave) -> | |
ErrorMsg = "unable to add shard", | |
case ?NEW_SHARD_KEY of | |
{error, _Msg} -> | |
{error, ErrorMsg}; | |
ShardId -> | |
case ?SHARD_KEY_FOR_MEMBERS(ShardId) of | |
{error, _Msg} -> | |
{error, ErrorMsg}; | |
ShardKey -> |
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_shard(Master, Slave) -> | |
ShardId = ?NEW_SHARD_KEY, | |
ShardKey = ?SHARD_KEY_FOR_MEMBERS(ShardId), | |
Members = ?ENCODE_MASTER_SLAVE(Master,Slave), | |
?REDIS(["SET",ShardKey,Members]), | |
{ok,ShardId}. |
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(baker_shard_tests). | |
-include_lib("eunit/include/eunit.hrl"). | |
-include_lib("baker.hrl"). | |
baker_shard_test_() -> | |
{ | |
setup, | |
fun() -> | |
ets:new(services, [named_table, set, public, {keypos, 2}]), |
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 is an HTML-embedded scripting language which attempts to make it | |
# easy for developers to write dynamically generated webpages. | |
# | |
LoadModule php5_module modules/libphp5.so | |
# | |
# Cause the PHP interpreter to handle files with a .php extension. | |
# |
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
############################################# | |
# Base Apache Server Configuration # | |
############################################# | |
User apache | |
Group apache | |
ServerAdmin root@localhost | |
ServerTokens OS | |
ServerRoot "/etc/httpd" | |
PidFile run/httpd.pid | |
Timeout 300 |
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
web: | |
type: php | |
db: | |
type: mysql | |
web: | |
type: php | |
name: api |