- version 3.6
Check those constraints:
$this->anything()
require 'yaml' | |
require 'active_record' | |
require 'active_record/connection_adapters/mysql_adapter' | |
class MysqlRaw | |
attr_accessor :connection | |
def initialize | |
@config = YAML::load(File.open("#{Rails.root}/config/database.yml"))["mysql_#{Rails.env}"] | |
@connection = ActiveRecord::Base.mysql_connection(@config) |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
function safemode() { // jacked from Syrian Shell | |
$safe_mode = ini_get("safe_mode"); | |
if (!$safe_mode) { | |
$safe_mode = 'off'; | |
} | |
else { | |
$safe_mode = 'on'; // ...fuck | |
} | |
return $safe_mode; |
$GearmanStatus = new GearmanStatus(); | |
$GearmanStatus->setStatsdConfig(array('host' => '127.0.0.1', 'port' => 8125, 'prefix' => 'gearmand', 'rate' => 1)); | |
$GearmanStatus->setGearmanConfig(array('host' => '127.0.0.1', 'port' => 4730)); | |
$GearmanStatus->setDebug(true || false); | |
$GearmanStatus->reset(); | |
$GearmanStatus->getCounters(); | |
$GearmanStatus->getStatus(); | |
$GearmanStatus->getWorkers(); | |
$GearmanStatus->getRawStatus(); | |
$GearmanStatus->transmitCountersToStatsD(); |
server { | |
listen 8080 default_server deferred; | |
charset utf-8; | |
access_log /var/log/nginx/graphite.access.log; | |
error_log /var/log/nginx/graphite.error.log; | |
root /opt/graphite/webapp; | |
location /static/admin/ { |
#!/bin/bash | |
options=('find' 'delete') | |
PS3='state your wish: ' | |
echo -e "\nfind/delete corrupt whisper-files" | |
select opt in "${options[@]}"; do | |
case $REPLY in | |
[12] ) option=$opt; break;; | |
* ) exit;; |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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: