To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| """Solarized theme for pantheon-terminal | |
| see http://ethanschoonover.com/solarized | |
| """ | |
| import posixpath | |
| import sys | |
| from gi.repository import Gio |
| var compose = function compose(f) { | |
| var queue = f ? [f] : []; | |
| var fn = function fn(g) { | |
| if (arguments.length) { | |
| queue.push(g); | |
| return fn; | |
| } | |
| return function() { | |
| var args = Array.prototype.slice.call(arguments); | |
| queue.forEach(function(func) { |
This is a very simply routing system that makes it easy to test requests to different paths. This is very limited so do not use for your applications - it's just for fun.
require('route.php');
// A user profile
route('/(\w+)/profile', function($path, $user)
{
print "Hello " . $user;
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
| package main | |
| import ( | |
| "database/sql" | |
| "errors" | |
| "fmt" | |
| _ "github.com/bmizerany/pq" | |
| "os" | |
| "regexp" | |
| "strings" |
| set :application, "App Name" # Your app name | |
| set :repository, "[email protected]:xxxxx/xxx.git" # Your git repository | |
| set :document_root, "/home/user/www/awesome_app" | |
| set :deploy_via, :remote_cache | |
| # SSH Settings | |
| set :user, "user_ssh" | |
| set :password, "password_ssh" | |
| set :use_sudo, false |
| #!/bin/sh | |
| # | |
| # An example hook script to prepare a packed repository for use over | |
| # dumb transports. | |
| # | |
| # To enable this hook, rename this file to "post-update". | |
| echo | |
| echo "**** Pulling changes into Live [Hub's post-update hook]" | |
| echo |
| #!/bin/bash | |
| echo "determining branch" | |
| if ! [ -t 0 ]; then | |
| read -a ref | |
| fi | |
| IFS='/' read -ra REF <<< "${ref[2]}" | |
| branch="${REF[2]}" |