Skip to content

Instantly share code, notes, and snippets.

@krakjoe
krakjoe / pthreads.md
Last active September 24, 2024 14:50
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 5, 2025 13:08
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

<?php
trait Singleton
{
protected static $_instance = null;
public static function getInstance()
{
if (static::$_instance === null
|| !(static::$_instance instanceof static)) {
@jaceju
jaceju / create_zf_project.sh
Created November 3, 2011 02:58
利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
#!/bin/bash
# Program:
# 利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
# History:
# 2011/11/03 Jace Ju First release
# Usage:
# Create template of project at first time:
# > cd /path/to/project_template
# > mkdir branches
# > mkdir tags
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby