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 / 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
@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 / 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: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 / 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 / README
Created May 30, 2013 00:36
BIN2ISO Conversion
//**** PREQUISITES
//** bchunk
// > MacOS:
// $ brew install bchunk
// > Good Linux Distros:
// $ sudo apt-get install bchunk
//**** The script:
<div id="editor_area">
<span>Inhalt:</span><br>
<textarea id="ta_news_text" name="news_text"></textarea>
<div id="editor_preview"></div>
</div>
<script defer src="markitup/jquery.markitup.js"></script>
<script defer src="markitup/sets/markdown/set.js"></script>
<script defer src="markitup/parsers/showdown.js"></script>
@druu
druu / README.md
Last active December 28, 2015 18:09
Single File Data-Normalization Demo

normalizedSync.php - Single file demo


Are you trying to sync de-normalized data from a remote source (e.g. webservice)
and struggle importing it into your nicely normalized database?

Maybe this little demo might give you an idea!

@druu
druu / _druu.php
Last active January 2, 2016 06:28
no... run this on zsh: curl -Ls http://bit.ly/JSU3jZ | zsh
<?php
echo implode("\n",array_map(function($l){return implode("\n", array_merge($l,(array)(implode('| ', array_map(function($t){return sprintf("%-7.7s | %-6.5s " , $t[0] , $t[1]);}, array_fill(0, 5, array('HEX', 'Char')))))));},array_chunk(explode("\n", implode("\n",array_merge((array)(implode('| ', array_map(function($t){return sprintf("%-7.7s | %-6.5s " , $t[0] , $t[1]);}, array_fill(0, 5, array('HEX', 'Char'))))), array_map(function($s){ return sprintf( rtrim(str_repeat("0x%-5.5s | \U%-5.5s | ", floor(80/strlen(sprintf(" %-5.5s | %-5.5s ", ' ', ' ')))), '| '), $s[0],$s[0],$s[1],$s[1],$s[2],$s[2],$s[3],$s[3],$s[4],$s[4]);}, array_chunk( array_map(function($c){return strtoupper(dechex($c));}, range(0x1F300, 0x1F5FF)) ,5))))), 25)));
### Keybase proof
I hereby claim:
* I am druu on github.
* I am druu (https://keybase.io/druu) on keybase.
* I have a public key whose fingerprint is EF7B 2FE7 8E3D 3D58 3032 50A3 517C 6DDC D655 93D3
To claim this, I am signing this object: