Skip to content

Instantly share code, notes, and snippets.

View dpnishant's full-sized avatar
🎯
Focusing

Nishant Das Patnaik dpnishant

🎯
Focusing
View GitHub Profile
if(location.href.match(/^https:\/\//gi)) {
var DOM = document.head.innerHTML.toString() + document.body.innerHTML.toString();
var http_urls = DOM.match(/http:\/\/[^\"\'\s]*/gi);
if(http_urls) {
for(var i=http_urls.length-1;i>=0;i--) {
if (http_urls[i] !== 'http://') {
if (http_urls[i].slice(-3).match(/png|jpg|gif|css|\.js|swf|mp4|svg/gi))
document.write(http_urls[i] + '<br/><br/>');
}
}}}
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/trunk/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/trunk/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@dpnishant
dpnishant / htmlEncode.js
Created September 20, 2013 11:45
htmlEncoder
function htmlEncode(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML.replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;").replace(/`/g,"&#x60;");
}
if (typeof YAHOO == "undefined" || !YAHOO) {
var YAHOO = {}
}
YAHOO.namespace = function () {
var A = arguments,
E = null,
C, B, D;
for (C = 0; C < A.length; C = C + 1) {
D = ("" + A[C])
.split(".");