Skip to content

Instantly share code, notes, and snippets.

Bojan Bjelić bojanbjelic

Block or report user

Report or block bojanbjelic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bojanbjelic /
Created Jan 16, 2012 — forked from jongalloway/
Recursive replace in files (PowerShell)
$find = 'jquery-1\.4\.4'
$replace = 'jquery-1\.5\.1'
$match = '*.cshtml' , '*.vbhtml'
$preview = $true
foreach ($sc in dir -recurse -include $match | where { test-path $_.fullname -pathtype leaf} ) {
select-string -path $sc -pattern $find
if (!$preview) {
(get-content $sc) | foreach-object { $_ -replace $find, $replace } | set-content $sc
View xml2json.xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/node()">
<xsl:apply-templates select="." mode="detect" />
bojanbjelic / stat.bash
Created Mar 6, 2012
List files with permissions
View stat.bash
stat -f '%A %a %N' *
bojanbjelic /
Created Apr 11, 2012 — forked from gka/
Local full-text search on tweets and favorites
cd /your/local/path/to/tweet-search/
rm last-results.html {query}
open last-results.html
bojanbjelic / .htaccess
Created Apr 20, 2012 — forked from necolas/.htaccess
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
View .htaccess
# Filename-based cache busting
# taken from
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
bojanbjelic / uri.js
Created Apr 24, 2012 — forked from jlong/uri.js
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "";
parser.protocol; // => "http:"
parser.hostname; // => ""
parser.port; // => "3000"
parser.pathname; // => "/pathname/"; // => "?search=test"
parser.hash; // => "#hash"; // => ""
bojanbjelic / edit-hosts
Created May 13, 2012
edit hosts file on mac osx
View edit-hosts
sudo nano /private/etc/hosts
dscacheutil -flushcache
View add_slug_to_body_class.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);
View wget.bash
wget --force-html -r -l2 2>&1 | grep '^--' | grep -v '\.\(txt\|ico\|css\|js\|png\|gif\|jpg\)$' > linklist.txt
View gist:2896108
wget --no-cache --spider -r -l 2 http://localhost/gvsi/ -o scan.log
You can’t perform that action at this time.