This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use PHP 5.4 | |
apt_repository "php54" do | |
uri "http://ppa.launchpad.net/ondrej/php5/ubuntu" | |
distribution node['lsb']['codename'] | |
components ["main"] | |
keyserver "keyserver.ubuntu.com" | |
key "E5267A6C" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: post | |
title: "Episode 3: ExpressionEngine StackExchange" | |
date: 2012-12-20 10:47 | |
comments: true | |
filename: some-file-name-without-extension | |
length: 52409154 | |
summary: ExpressionEngine Pro Anna Brown and Testing Hero Chris Hartjes join Ben Edmunds and Phil Sturgeon to discuss the recent rumblings in the ExpressionEngine community and the new EE StackExchange site. We talk about Inversion of Control (IoC), what it is, why its useful and how it's done. | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: kapture | |
# Recipe:: ci | |
# | |
# Future Phil - When shit breaks try this: | |
# http://sqa.stackexchange.com/questions/5242/jenkins-fails-to-restart-after-updating-plugins | |
app_name = 'kapture-ci' | |
app_config = node[app_name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Object.const_missing(name) | |
@looked_for ||= {} | |
str_name = name.to_s | |
raise "Class not found: #{name}" if @looked_for[str_name] | |
@looked_for[str_name] = 1 | |
file = str_name.gsub!(/(.)([A-Z])/,'\1/\2') && downcase! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
$this->sentry->authenticate(array( | |
'email' => $email, | |
'password' => $password, | |
), (bool) $this->input->post('remember')); | |
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) { | |
// Could not log in with password. Maybe its an old style pass? | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
git clone http://git.php.net/repository/php-src.git -b PHP-5.5 | |
cd php-src | |
./buildconf | |
./configure --disable-all --enable-debug --enable-maintainer-zts | |
make test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php > $i = ''; | |
php > var_dump(++$i); | |
string(1) "1" | |
php > var_dump(++$i); | |
int(2) | |
php > var_dump(++$i); | |
int(3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$users = [['id' => 1, 'name' => 'Jack'], ['id' => 2, 'name' => 'Jill']]; | |
echo implode(',', array_map(function($u) { return "'{$u['id']}'"; }, $users)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apns import APNs, Payload, PayloadAlert | |
import time | |
tokens = [u'tokenhexabcdef0123456789'] | |
apns = APNs(use_sandbox=True, cert_file='client.pem', key_file='key.pem') | |
alert = PayloadAlert("", loc_key="FOO", loc_args=['Some Guy']) | |
payload = Payload(alert=alert, sound="default", badge=1) | |
for token in tokens: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function autoload($className) | |
{ | |
if (file_exists('autoload.php')) { | |
require_once('autoload.php'); | |
return; | |
} | |
$className = ltrim($className, '\\'); | |
$fileName = ''; | |
$namespace = ''; | |
if ($lastNsPos = strrpos($className, '\\')) { |