Skip to content

Instantly share code, notes, and snippets.

View davidcoallier's full-sized avatar

David Coallier davidcoallier

View GitHub Profile
Index: php_spl.c
===================================================================
--- php_spl.c (revision 290576)
+++ php_spl.c (working copy)
@@ -359,6 +359,97 @@
}
}
+
+/* {{{ spl_strrpos_ascii: borrowed from the php ext/standard/string.c */
// ==UserScript==
// @name Assembla Changeset Navigator
// @namespace echolibre
// @description In assembla, navigate to previous and next changeset
// @include https://code.assembla.com/*
// @date 2009-03-02
// @version 1.0
// ==/UserScript==
var GM_JQ = document.createElement('script');
function(doc) {
if (doc.name && doc.value) {
emit(doc.name, doc.value);
}
}
%% Map Function
%%
%% This map function will output the doc.name as the key
%% and the doc.value as the value of that key.
%%
%% In javascript the code would look like:
%%
%% function(doc) {
%% if (doc.name && doc.value) {
%% emit(doc.name, doc.value);
%% Map Function
%% Thanks to Adam Kocoloski (@kocolosk) for this compacted version
fun({Doc}) ->
case {proplists:get_value(<<"name">>, Doc), proplists:get_value(<<"value">>, Doc)} of
{undefined, _} ->
ok;
{_, undefined} ->
ok;
{Name, Value} ->
Emit(Name, Value);
<?php
namespace lithium\marketing\book\chapter;
class One {}
class Two {}
diff --git a/models/SphereView.php b/models/SphereView.php
index 5e778d2..f7b8b26 100644
--- a/models/SphereView.php
+++ b/models/SphereView.php
@@ -13,14 +13,14 @@ class SphereView extends \lithium\data\Model {
'views' => array(
'posts' => array(
'map' => 'function(doc) {
- if (doc.type == "post") {
+ if (doc.type && doc.type == "post" && doc.created) {
<?php
$n = 50;
$k = 7;
function boom($var) {
$return = 1;
while ($var > 0) {
$return = ($return * $var);
fun({Doc}) ->
case {proplists:get_value(<<"id">>, Doc)} of
{undefined} ->
ok;
{Id} ->
Emit(Id, Doc);
_ ->
ok
end
end.

Meta

     API Documentation, generated 2010-03-23T17:31:18+00:00
     Actions      : 3
     Errors       : 3
     Output Types : 5

Actions