This file contains 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
#!/usr/bin/env zsh | |
branch=`git rev-parse --abbrev-ref HEAD` | |
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' | |
# How it works: | |
# 1| Display a textual history of all commits. | |
# 2| Ancestors of the current commit are indicated | |
# by a star. Filter out everything else. |
This file contains 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
import 'dart:html' show Console; | |
void main() { | |
var console = new Console(); | |
console.log("ok ab dart!"); | |
} | |
// to compile use: | |
// dart2js -oab.js ab.dart |
This file contains 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
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
x := make([]uint8, dx) | |
y := make([][]uint8, dy) | |
for n := range y { | |
y[n] = x |
This file contains 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 | |
$criteria = new \ext\activedocument\Criteria; | |
$criteria->addMapPhase(' | |
function(value, keyData, arg) { | |
if(!value["not_found"]) { | |
var object = Riak.mapValuesJson(value)[0]; | |
if(object.hasOwnProperty(arg.col) && object[arg.col] instanceof Array) { | |
if(object[arg.col].indexOf(arg.val) != -1) | |
return [[value.bucket,value.key]]; | |
} |
This file contains 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 | |
use \ext\activedocument\Criteria; | |
$criteria = new Criteria; | |
$criteria->addColumnCondition(array('slug'=>$slug)); | |
$category = Category::model()->find($criteria); | |
$criteria = new Criteria; | |
$criteria->order='updated ASC'; |
This file contains 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 | |
$ordersForShipping=new CActiveDataProvider( Orders::model()->with(array( | |
'cart'=>array( | |
/* | |
* Ensure occurs in same query | |
*/ | |
'together'=>true, | |
'joinType'=>'INNER JOIN', | |
'with'=>array( |
This file contains 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
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 et | |
[ | |
%% Riak Core config | |
{riak_core, [ | |
%% Default location of ringstate | |
{ring_state_dir, "data/ring"}, | |
%% http is a list of IP addresses and TCP ports that the Riak | |
%% HTTP interface will bind. |