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
View gist:3f995b426c2f0d9039a6
DateTime.Now.ToUniversalTime().ToString("o");
View gist:43ac18e33ad87d1df921
### Keybase proof
I hereby claim:
* I am bojanbjelic on github.
* I am bojanbjelic (https://keybase.io/bojanbjelic) on keybase.
* I have a public key whose fingerprint is 555A 849B 26DF 25C3 A7D3 56B3 A4A8 F039 9FB1 58BB
To claim this, I am signing this object:
@bojanbjelic
bojanbjelic / scan.cmd
Created Aug 19, 2015
wget directory structure (auto index, browsing allowed)
View scan.cmd
wget -nv -r -np -N --spider -l 6 --no-check-certificate -e robots=off --reject-regex="(\?C=)|(.*/img)|(.*/icons)|(.*/audio)|(.*/css)|(.*/img)|(.*/js)|(.*/swf)|(.*/images)|(.*/video)|(.*/sound)" -R "ico,html,txt,xml,json,jar,swf,zip,7z,unity3d,xnb,mp3,ogg,md5,pdb,exe" "http://www.example.int/"
@bojanbjelic
bojanbjelic / RecursiveReplace.ps
Created Jan 16, 2012 — forked from jongalloway/RecursiveReplace.ps
Recursive replace in files (PowerShell)
View RecursiveReplace.ps
$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="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/node()">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="." mode="detect" />
<xsl:text>}</xsl:text>
</xsl:template>
@bojanbjelic
bojanbjelic / stat.bash
Created Mar 6, 2012
List files with permissions
View stat.bash
stat -f '%A %a %N' *
@bojanbjelic
bojanbjelic / alfred-script.sh
Created Apr 11, 2012 — forked from gka/alfred-script.sh
Local full-text search on tweets and favorites
View alfred-script.sh
cd /your/local/path/to/tweet-search/
rm last-results.html
search.py {query}
open last-results.html
@bojanbjelic
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 https://github.com/h5bp/html5-boilerplate/
# 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
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 = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
You can’t perform that action at this time.