Skip to content

Instantly share code, notes, and snippets.

@bojanbjelic
bojanbjelic / add_slug_to_body_class.php
Created May 21, 2012 15:17 — forked from keirwhitaker/add_slug_to_body_class.php
WordPress Page Template Snag Lists
<?php
// Add the filter and function to your functions.php file
add_filter('body_class', 'add_slug_to_body_class');
function add_slug_to_body_class($classes) {
global $post;
if(is_page()) {
$classes[] = sanitize_html_class($post->post_name);
};
@bojanbjelic
bojanbjelic / wget.bash
Created May 21, 2012 21:12
Site link list
wget --force-html -r -l2 http://www.bjelic.net 2>&1 | grep '^--' | grep -v '\.\(txt\|ico\|css\|js\|png\|gif\|jpg\)$' > linklist.txt
@bojanbjelic
bojanbjelic / gist:2896108
Last active October 5, 2015 23:37
wget test site
wget --no-cache --spider -r -l 2 http://localhost/gvsi/ -o scan.log
@bojanbjelic
bojanbjelic / qwinsta
Last active October 7, 2015 09:28
check network connections on remote windows server
qwinsta /server:webnet2
@bojanbjelic
bojanbjelic / gist:3151427
Created July 20, 2012 15:39
css linear gradient
background: #D9DBDB;
background: -moz-linear-gradient(left,rgba(217, 219, 219, 1) 0%,rgba(240, 242, 242, 1) 100%);
background: -webkit-gradient(linear,left top,right top,color-stop(0%,rgba(217, 219, 219, 1)),color-stop(100%,rgba(240, 242, 242, 1)));
background: linear-gradient(left,rgba(217, 219, 219, 1) 0%,rgba(240, 242, 242, 1) 100%);
@bojanbjelic
bojanbjelic / gist:3931503
Created October 22, 2012 13:27
jQuery ajax wait pattern
function getTwoThings( callback ) {
var peopleRequest = $.getJSON( '/data/people.json' );
var taskRequest = $.getJSON( '/data/tasks.json' );
$.when( peopleRequest, taskRequest )
.done(function( people, tasks ) {
callback( people[0].people, tasks[0].tasks );
});
}
@bojanbjelic
bojanbjelic / gist:3944576
Created October 24, 2012 07:35
Remove whitespace around text fields
input,
textarea {
margin:0;
vertical-align:bottom;
}
/*
If you want to affect only text inputs you could use input[type="text"] instead of input. Other values for vertical-align, like top or middle, will also work.
*/
@bojanbjelic
bojanbjelic / cleanup.sh
Created November 18, 2012 00:37
cleanup email html
perl -pi -w -e 's/=3D/=/g;' $1
perl -pi -w -e 's/(=\r\n)|=20|=0D|=09//g;' $1
@bojanbjelic
bojanbjelic / flushdns.sh
Created December 2, 2012 23:21
mac osx lion flush DNS cache
sudo killall -HUP mDNSResponder
sudo dpkg --remove --force-remove-reinstreq pkg_name