Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
<?php | |
require_once __DIR__ . '/../lib/vendor/Silex/silex.phar'; | |
$app = new Silex\Application(); | |
$app['debug'] = true; | |
// Registering Symfony\Yaml and Symfony\Config | |
$app['autoloader']->registerNamespace('Symfony', __DIR__.'/../lib/vendor/symfony/src'); |
{ | |
"scope": "source.js -string -comment -constant", | |
"completions": [ | |
{ "trigger": "customtrigger.allowBlank\tBoolean", "contents": "allowBlank: $1${2:,}" }, | |
{ "trigger": "customtrigger.allowOnlyWhitespace\tBoolean", "contents": "allowOnlyWhitespace: $1${2:,}" }, | |
{ "trigger": "customtrigger.blankText\tString", "contents": "blankText: '$1'${2:,}" }, | |
{ "trigger": "customtrigger.checkChangeBuffer\tNumber", "contents": "checkChangeBuffer: $1${2:,}" }, | |
{ "trigger": "customtrigger.checkChangeEvents\tString[]", "contents": "checkChangeEvents: ['$1']${2:,}" }, | |
{ "trigger": "customtrigger.dirtyCls\tString", "contents": "dirtyCls: '$1'${2:,}" }, |
import sqlite3 | |
# open connection and get a cursor | |
conn = sqlite3.connect(':memory:') | |
c = conn.cursor() | |
# create schema for a new table | |
c.execute('CREATE TABLE IF NOT EXISTS sometable (name, age INTEGER)') | |
conn.commit() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
### ADD RPM Forge repository | |
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm | |
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt | |
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # Verifies the package | |
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm | |
### APACHE | |
# Dependencies |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
- Go HTTP standalone (as the control group)
- Nginx proxy to Go HTTP
- Nginx fastcgi to Go TCP FastCGI
- Nginx fastcgi to Go Unix Socket FastCGI
Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.
fs.file-max = 1000000
2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.
net.ipv4.tcp_max_syn_backlog = 3240000
3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.
net.core.somaxconn = 3240000
packages: | |
yum: | |
php55-fpm: [] | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | |
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |