IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available
)!
Remove old nginx incl. nginx-common:
apt-get autoremove --purge nginx nginx-common
package racecondition_test | |
import ( | |
"fmt" | |
"sync" | |
"sync/atomic" | |
"testing" | |
"time" | |
) |
import time | |
class Bucket(object): | |
def __init__(self, max_amount, refill_time, refill_amount): | |
self.max_amount = max_amount | |
self.refill_time = refill_time | |
self.refill_amount = refill_amount | |
self.reset() | |
def _refill_count(self): |
package main | |
// The aim of this example is to illustrate backpressure using golang channels and go routines. | |
// | |
// This is the basis for a simple data processing service which could either be reading from | |
// some internal queue or a socket of some sort. | |
import ( | |
"fmt" | |
"math/rand" |
#!/usr/bin/env ruby | |
require 'helpscout' | |
require 'fileutils' | |
require 'json' | |
api_key = ARGV[0] | |
helpscout = HelpScout::Client.new(api_key) | |
module InstanceVariablesToJson |
I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.
Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
#!/usr/bin/env bash | |
branch=`git branch | grep '*' | awk '{print $2}'` | |
get_files() { | |
if test "$1" = "fbranch"; then | |
echo `git diff develop..$branch --name-status | egrep '[AM]\t' | awk '{print $2}' | grep '.py'` | |
else | |
echo `git status --porcelain | egrep '[AM] ' | awk '{print $2}' | grep '.py'` | |
fi |
#!/usr/bin/env bash | |
branch=`git branch -a | egrep -io "([^/]+/)?[^/]+$1$" | sed 's/* //' | head -1` | |
git checkout $branch |
class CORSResource(object): | |
""" | |
Adds CORS headers to resources that subclass this. | |
""" | |
def create_response(self, *args, **kwargs): | |
response = super(CORSResource, self).create_response(*args, **kwargs) | |
response['Access-Control-Allow-Origin'] = '*' | |
response['Access-Control-Allow-Headers'] = 'Content-Type' | |
return response |