Skip to content

Instantly share code, notes, and snippets.

View druu's full-sized avatar

David Wosnitza druu

  • Wuppertal, Germany
View GitHub Profile
@druu
druu / album.php
Created October 22, 2012 10:53 — forked from nicekiwi/album.php
presenter photos thing
<?php // my view ?>
<h1><?php echo $album_info['0']['album_name'] ?></h1>
<a href="/photos/<?php echo $album_info['0']['album_year'] ?>" title="Back to Albums">Back to Albums</a>
<ul class="photo-items">
<?php foreach($album_photos as $k => $v) {$album_photos[$k] = (object) $v;} ?>
<?php $album_presenter->partial('list_photos'); ?>
@druu
druu / gist:3901226
Created October 16, 2012 18:56
Bookmarklet: Clean up Google's search result URLs
javascript:(function(){var links=document.querySelectorAll('a.l'),count=links.length;while(count--){links[count].onmousedown=null;if((/url=/i).test(links[count].href)){links[count].href=decodeURIComponent(links[count].href.match(/url=([a-z0-9\-+%._]+)&/i)[1].replace(/\+/g, ' '));}};})()
@druu
druu / MicroACL.php
Created October 10, 2012 14:14
Micro ACL Library (coupled with Bitauth)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MicroACL {
private $CI;
private $is_loaded = false;
private $my_role = null;
private $my_perms = array();
@druu
druu / gist:2652454
Created May 10, 2012 11:07
Helper function for creating and highlighting Twitter Bootstrap Nav-Links
if (! function_exists('nav_link'))
{
/**
* Helper function for creating and highlighting Twitter Bootstrap Nav-Links
* david.wosnitza // 2012-05-10 13:05:34
*
* @param string $uri The URI you want to Navigate to
* @param string $title Your Link text
* @param boolean $home Activation override: Highlights on if URI is empty
* @param integer $level Choose the URI segment to comare to
@druu
druu / Less Compile.sublime-build
Created November 8, 2011 09:57
LessCSS Build System for Sublime Text 2
/**
* Basic LessCSS Build System for Sublime Text 2
*
* Prerequisites: node.js, global lesscss node module
* How it works:
* 1. Create the folders "src/css" and "assets/css" in your project root
* 2. Put all your .less files into "src/css"
* 3. Open your main .less file and hit "Build"
* 4. Dance happily around your minified and compiled CSS file in "assets/css"
* 5. Profit