Skip to content

Instantly share code, notes, and snippets.

View julianwachholz's full-sized avatar
🤓

Julian Wachholz julianwachholz

🤓
View GitHub Profile
#!/usr/bin/env node
/*
* Bullshit Bingo Bot.
* 1) Fix the configuration to your liking and run
* 2) Use "!bullshit" and the word you want on the pile
* 3) ????
* 4) BINGO!
*
* Send complaints, cheques or anthrax to privacymyass@gmail.com.
@julianwachholz
julianwachholz / autoloader.php
Created October 7, 2011 19:53
A namespace based autoloader
<?php
spl_autoload_register(function($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
// Convert the PascalCased names to snake_case
$path = preg_replace('/([a-z])([A-Z](?![A-Z]))/', '$1_$2', $path);
$path = strtolower($path);
$path = LIB_PATH . '/' . $path . '.php';
<?php
namespace Feature\Testing\Annotations;
/* *
* This script does not yet belong to the FLOW3 framework. *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
# Don�t link the last breadcrup-link
<?php
$extList = array(
'css_styled_content',
'extbase',
'filelist',
// usw.
);
$TYPO3_CONF_VARS['EXT']['extList'] = implode(',', $extList);
coffee:
@echo "make it yourself, lazy bum"
/**
* Fills in the markerArray with data for a news item
*
* @param array $row : result row for a news item
* @param array $textRenderObj : conf vars for the current template
* @param [type] $textRenderObj: ...
* @return array $markerArray: filled marker array
*/
function getItemMarkerArray($row, $lConf, $textRenderObj = 'displaySingle') {
@julianwachholz
julianwachholz / urls.py
Created March 16, 2013 19:53
Conditional urls?
if settings.DEBUG:
urlpatterns += patterns(
'',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
}),
)
@julianwachholz
julianwachholz / gist:5211963
Created March 21, 2013 10:06
We're lazy, SSH is verbose. Use this. ;)
~ cat .ssh/config
Host client
Hostname some-client-prd.example.com
User julian.wachholz
IdentityFile ~/.ssh/id_work
@julianwachholz
julianwachholz / app.scss
Last active December 15, 2015 14:29
Many different class names that need similar rules. Easy solution with SCSS.
$categories: (
'somecategory' $yellow,
'othercategory' $green,
'thirdcategory' $blue
);
@function category-classes($prefix: '') {
$classes: ();
@each $category in $categories {
$name: nth($category, 1);