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 | |
define('FLAG_0', 1); | |
define('FLAG_1', 2); | |
define('FLAG_2', 4); | |
define('FLAG_3', 8); | |
/** | |
* Will fail when setting multiple flags at once | |
*/ |
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 Flattr | |
{ | |
const VERSION = '0.9.18'; | |
const WP_MIN_VER = '2.9'; | |
const API_SCRIPT = 'api.flattr.com/js/0.6/load.js?mode=auto'; | |
/** @var array */ | |
protected static $categories = array('text', 'images', 'audio', 'video', 'software', 'rest'); |
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 | |
/** | |
* (extremely) simple class to convert a DOMNode to an array. | |
* @todo Add support for attributes, namespaces and other goodies... | |
*/ | |
class XmlToArray | |
{ | |
/** | |
* Checks if node has any children other than just text | |
* |
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 | |
# | |
# Use this to include all vhost files in to lighttpd.conf | |
# In lighttpd.conf add the line: include_shell "/etc/lighttpd/vhosts.sh" | |
# | |
VHOST_PATH="/etc/lighttpd/vhosts/*" | |
for f in $VHOST_PATH | |
do | |
cat $f |
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
diff --git 0.11/access/macro.py 0.11/access/macro.py | |
index 7ea2e23..70ed06f 100644 | |
--- 0.11/access/macro.py | |
+++ 0.11/access/macro.py | |
@@ -11,6 +11,7 @@ import re | |
from trac.core import * | |
from trac.wiki.api import IWikiMacroProvider | |
from trac.wiki.formatter import format_to_html | |
+from trac.perm import PermissionSystem, IPermissionStore | |
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
" Barebones example of how to make a simple vim syntax file. | |
" Language: todofile | |
" Maintainer: leihog | |
"if exists ("b:current_syntax") | |
" finish | |
"endif | |
let b:current_syntax = "todo" | |
" v:folddashes a string that contains dashes to represent the foldlevel. |
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 MyPlugin extends Plugin | |
{ | |
private $modules = array(); | |
private function loadModules() | |
{ | |
$base_path = dirname(__FILE__) . '/modules/'; | |
$dh = opendir( $base_path ); |
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 | |
function colorize($str, $fg = 'white', $bg = false) | |
{ | |
$fg = str_replace(array('-','_'), '', $fg); | |
switch($fg) { | |
case 'black': $fg = "0;30"; break; | |
case 'yellow': $fg = "1;33"; break; | |
case 'brown': $fg = "0;33"; break; | |
case 'green': $fg = "0;32"; break; |
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
Start Terminal.app and then type: | |
$ cd ~/Library/Application Support/Steam/SteamApps/common/Shatter/Shatter.app/Contents/Frameworks/Cg.framework | |
$ ln -s Versions/1.0/Cg Cg |
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
- hosts: all | |
vars: | |
node_version: "0.10.28" | |
tasks: | |
- name: Check for node.js | |
shell: test "$(node -v 2> /dev/null)" = v{{node_version}} | |
register: nodejs_installed | |
ignore_errors: True | |
tags: | |
- nodejs |
OlderNewer