Skip to content

Instantly share code, notes, and snippets.

View timjb's full-sized avatar

Tim Baumann timjb

View GitHub Profile
<?php
if(!isset($url)) return '';
$name = dechex(rand(0, 12345678));
return <<< EOT
<div id=swfcontainer{$name}></div>
<script>
// requires MooTools
<?php
// Parameter: &directory
if(!function_exists('outputDir')) {
function outputDir($dir) {
if(substr($dir, -1) != '/') {
$dir .= '/';
}
if(!is_dir($dir)) {
return $dir.' ist kein Verzeichnis!';
<?php
# Snippet to include files from filesystem
# [[includeFile? &file=`assets/templates/mytemplate/file.html`]]
if ( !isset($file) || $file== "" ) return "No file specified."; //check if there's a file given.
//Start the buffer
ob_start();
//include
<?php
if(isset($text)) {
include_once 'assets/snippets/markdown.php';
return Markdown($text);
}
?>
<?php
include 'assets/snippets/bosssearch.php';
return bossSearch();
?>
include Nanoc3::Helpers::LinkTo
# COPIED FROM http://github.com/ddfreyne/nanoc/blob/master/lib/nanoc3/base/compilation/compiler_dsl.rb
# Converts the given identifier, which can contain the '*' or '+'
# wildcard characters, matching zero or more resp. one or more
# characters, to a regex. For example, 'foo/*/bar' is transformed
# into /^foo\/(.*?)\/bar$/ and 'foo+' is transformed into /^foo(.+?)/.
def identifier_to_regex(identifier)
if identifier.is_a? String
# Add leading/trailing slashes if necessary
PATH = ".vim/bundle"
def github_url(user, repo)
"http://github.com/#{user}/#{repo}.git"
end
def sh(cmd)
print cmd
system cmd
end
var spawn = require('child_process').spawn;
var EventEmitter = require('events').EventEmitter;
///////////
// Sound //
///////////
function Sound(str, lang, amplitude, speed) {
EventEmitter.apply(this);
/* You may want to style this to your personal need */
.achievement.status {
display: none;
position: absolute;
left: 50%;
bottom: -120px;
margin-left: -160px;
}