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
'use strict'; | |
var STYLE_ATTRIBUTE = 'text-style-name'; | |
var styleMatches = function (item, styleName) { | |
if (!item || item.attributes === undefined || item.attributes[STYLE_ATTRIBUTE] === undefined) { | |
return false; | |
} | |
return item.attributes[STYLE_ATTRIBUTE].match(styleName); |
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
Conditionals | |
( false :) | |
console.log "if" | |
:( true ) | |
console.log "else if" | |
:() | |
console.log "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
#!/bin/bash | |
# Requirements: sed, grep, curl, pkill | |
# User configuration | |
LOCAL_INSTALL="/usr/lib/sublime-text-2" # Must be user-writable | |
REPO="dev" # "dev" for dev releases, or "2" for beta releases | |
TARGET_BUILD="Linux 32 bit" # can be one of "Windows", "Windows 64 bit", "OS X", "Linux 32 bit", "Linux 64 bit" | |
# Check if sublime text is running |
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 | |
class sfSearchTask extends sfCommandApplicationTask | |
{ | |
/** | |
* @see sfTask | |
*/ | |
protected function configure() | |
{ | |
$this->addArguments(array( |
This guide is now available under this URL:
http://docs.behat.org/cookbook/bdd_in_symfony2_with_behat_mink_and_zombiejs.html
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
# use with: | |
# | |
# varnishadm -T host:port -S /etc/varnish/secret "vcl.load sopa /path/to/your/sopa.vcl" | |
# varnishadm -T host:port -S /etc/varnish/secret "vcl.use sopa" | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
} |
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
// | |
// Place this at the beginning of your node.js program before | |
// **any and all** require statements. | |
// | |
var util = require('util'); | |
var _warning = util._deprecationWarning; | |
util._deprecationWarning = function () { | |
console.trace(); | |
_warning.apply(util, arguments); |
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
function svn-bisect() { | |
local TEST="$1" | |
local TARGET="${2:-.}" | |
local LEFT=${3:-1} | |
local RIGHT=${4:-$(LANG=LC svn info | grep ^Revision | sed 's/Revision: //')} | |
if ! echo "$LEFT" | grep '^[0-9]\+$' > /dev/null; then | |
echo 'Starting revision must be a valid number' >&2 | |
exit 1 | |
fi |
OlderNewer