Skip to content

Instantly share code, notes, and snippets.

function run_function($name, $params) {
// Actually run the function in question
}
while(true) {
// Wait for a connection and extract the function to start
if (function_exists('pcntl_fork')) {
$pid = pcntl_fork();
if ($pid == -1) {
def record_purchase(customer, basket)
basket.each do |product|
product.buyers << customer
end
# Render these into the relation map -- this can be done out of process too
basket.each do |x|
all_products.each do |y|
intersection[x][y] = x.buyers.intersect(y.buyers).count
end
whereami()
{
export THIS_IS_NOT_MY_BEAUTIFUL_HOUSE=$1
}
__thereami()
{
local curtask="$THIS_IS_NOT_MY_BEAUTIFUL_HOUSE"
if [ -n "$curtask" ]; then
if [ -n ${1-} ]; then
I have a nested set of hashes like:
[A]
[B]
[C]
[D]
[E]
[F]
[A']
[B']
I have a nested set of hashes like:
[A]
[B]
[C]
[D]
[E]
[F]
[A']
[B']
class FrameProfiler {
// The root frame is the top-most frame in this trace. It is an error to try and pop it.
private $frameStack;
function FrameProfiler() {
$this->frameStack = array();
$this->enterSection("root");
}
function enterSection($name) {
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
backend
=======
while true do
select(listener, 1s)
if commands
send them
end
if get_button
send beep down button pipe
if (i == 5)
handleIEqualToFive();
doSomethingElseCompletelyUnrelated();
doYetAnotherUnrelatedThing();
...
...
[{"name":"playback","filename":"1"},
{"name":"playback","filename":"3"}]