Skip to content

Instantly share code, notes, and snippets.

View gr4y's full-sized avatar

Sascha Wessel gr4y

View GitHub Profile
@gr4y
gr4y / .bashrc
Created September 11, 2010 14:59
# show the actual git branch in command line prompt
export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") $ '
alias /sync "/media/disk/sync"
<Directory "/media/disk/sync">
Dav On
Allow from all
</Directory>
#
# doesn't work with iWorks for iPad
# shame on apple
#
.unread #alert_beacon, .unread_generic { background-color: black; }
@gr4y
gr4y / error
Created December 23, 2010 11:42
Request from "fe80::cabc::c8ff:fe05:3967%eth1" using invalid Host: field "atlantis.local"
We couldn’t find that file to show.
mkdir src
cd src
git clone git://github.com/tjfontaine/airprint-generate
cd airprint-generate
./airprint-generate.py
cp *.service /etc/avahi-daemon/services
sudo service avahi-daemon restart
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:883:in `source_index'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:841:in `new'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:841:in `block in searcher'
from <internal:prelude>:10:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:840:in `searcher'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:479:in `find_files'
@gr4y
gr4y / index.php
Created May 23, 2011 15:12
how to get wordpress custom post types into your loop?
<?php query_posts( array( 'post_type' => array( 'g4w_photo', 'post' ) ) );
if (have_posts()) : while(have_posts()) : the_post(); ?>
<?php get_template_part('parts/article'); ?>
<?php endwhile; else: ?>
<?php get_template_part('parts/404'); ?>
<?php endif; ?>
@gr4y
gr4y / boolcrap.php
Created May 24, 2011 21:20
Oh dear... 1 reason out of 30 bazillion reasons why PHP is crap!
var_dump((bool) "false"); // returns bool(true)
function g4w_feed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']) && get_option('g4w_photo_loop') == "true")
$qv['post_type'] = array('post', 'g4w_photo');
return $qv;
}
add_filter('request', 'g4w_feed_request');