Get a VPS that offers 2 or more IP addresses.
From the WHM cPanel, find the menu item Service Configuration
, select Apache Configuration
and then click on Reserved IPs Editor
.
packages: | |
yum: | |
php55-fpm: [] | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | |
files: | |
"/home/ec2-user/install-cluster-client.sh": | |
mode: "000744" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
#hide old ini | |
if [ -a /etc/php.d/50-memcached.ini ] | |
then |
server { | |
listen 80; | |
server_name forum.example.com; | |
root /var/www/example_forum/; | |
index index.php; | |
access_log /var/log/nginx/forum.example.access.log main; | |
error_log /var/log/nginx/forum.example.error.log; |
<snippet> | |
<content><![CDATA[ | |
// ${1} Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
<?php | |
Route::filter('cache', function($response = NULL) { | |
$cname = 'response-' . Str::slug(URI::full()); | |
if (!$response) { | |
return Cache::get($cname); | |
} | |
else if ($response->status == 200) { | |
$ctime = floor(pow(current(sys_getloadavg()) + 1, 5)); # cache for between 1 and 32 minutes | |
Cache::put($cname, $response, $ctime); |
<?php | |
class Auth_Controller extends Base_Controller { | |
public $restful = true; | |
public function __construct() { | |
$this->filter( 'before', 'guest' )->except( array( 'logout', 'validate' ) ); | |
// Note: We may not always require CSRF on login for system based logins so ignore it here. | |
$this->filter( 'before', 'csrf' )->on( 'post' )->except( array( 'login' ) ); | |
} |
{ | |
"Records": [ | |
{ | |
"EventSource":"aws:sns", | |
"EventVersion":"1.0", | |
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx", | |
"Sns": { | |
"Type":"Notification", | |
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A", | |
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery", |
(function(j,q,u,e,r,y,R,o,x){try{o=jQuery;if(o&&(!R||(R&&o.fn.jquery==R))){x=true}}catch(er){}if(!x||(R&&o.fn.jquery!=R)){(q=j.createElement(q)).type='text/javascript';if(r){q.async=true}q.src='//ajax.googleapis.com/ajax/libs/jquery/'+(R||1)+'/jquery.min.js';u=j.getElementsByTagName(u)[0];q.onload=q.onreadystatechange=(function(){if(!e&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){e=true;x=jQuery;jQuery.noConflict(true)(function(){y(x)});q.onload=q.onreadystatechange=null;u.removeChild(q)}});u.appendChild(q)}else{y(o)}})(document,'script','head',false,false,(function($){$(function(){ | |
/* code goes here */ | |
console.log($.fn.jquery); | |
})})); | |
// readable: | |
(function (j, q, u, e, r, y, R, o, x ) { | |
// IE8 undefined crash fix | |
try { |
function escapeString(string) { | |
string = string.replace(/\\/g, "\\\\"). | |
replace(/\n/g, "\\n"). | |
replace(/\r/g, "\\r"). | |
replace(/\t/g, "\\t"); | |
if (string.indexOf("'") < 0) { | |
return "'" + string + "'"; | |
} | |
string = string.replace(/"/g, "\\\""); | |
return '"' + string + '"'; |