#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id:
packages: | |
yum: | |
php55-fpm: [] | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | |
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; |
container_commands: | |
01_collectstatic: | |
command: "django-admin.py collectstatic --noinput" | |
02_lesscss: | |
command: "lesscpy -x static/css/base.less > static/css/base.css" | |
03_setup_apache: | |
command: "cp enable_mod_pagespeed.conf /etc/httpd/conf.d" | |
04_rm_pagespeed: | |
command: "rm -rf /pagespeed/ebextensions" | |
05_mkdir_pagespeed: |
#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id:
<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 | |
require 'vendor/autoload.php'; | |
$loop = new React\EventLoop\StreamSelectLoop(); | |
$app = function ($request, $response) use ($loop) { | |
$response->writeHead(200, []); | |
$fh = fopen('http://localhost/', 'r'); |
<?php | |
/** | |
* Base Model | |
* | |
* @package Extends Model Laravel | |
* @version 1.0 | |
* @author Purwandi <[email protected]> | |
* @link http://purwand.me | |
*/ | |
class Base extends Eloquent{ |
TAFFY.extend( 'capped', function( i, runInsert, runRemove ) { | |
var c = this.getDBI().cap || false; | |
if( c && ( c < ( this.count() + 1 ) ) ) { | |
while( c < ( this.count() + 1 ) ) { | |
this.getDBI().remove( this.context().results[0].___id ); | |
this.context({ | |
run: null | |
}); | |
this.getDBI().removeCommit( runRemove ); | |
} |
<?php | |
/** | |
* CIDR.php | |
* | |
* Utility Functions for IPv4 ip addresses. | |
* Supports PHP 5.3+ (32 & 64 bit) | |
* @author Jonavon Wilcox <[email protected]> | |
* @revision Carlos Guimarães <[email protected]> | |
* @version Wed Mar 12 13:00:00 EDT 2014 | |
*/ |