This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: This assumes you are running from command line. To run from batch script, add the next commented out line to the top of | |
:: your batch file. Also, in a batch file the % sign before the i should be doubled, .e.g. %%i. | |
:: batch file only - remove preceeding semicolons from the next line and insert in batch file. | |
:: SETLOCAL ENABLEDELAYEDEXPANSION | |
:: from command prompt only - add the next line | |
cmd /v:on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDocTypeStr(htmlStr){ | |
var getByXMLNS,docTypeStr, index=htmlStr.indexOf('<head>'); | |
getByXMLNS=function(){ | |
if(!htmlStr.match(/xmlns/i)){ | |
return false; | |
} else { | |
var index_tmp,docTypeStr,newIndex,index=htmlStr.indexOf('xmlns'), | |
sub_tmp=htmlStr.substr(index); | |
index_tmp=sub_tmp.indexOf('>'); | |
newIndex=index_tmp + index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 'elem' Should Be Replaced With the name of the tag to matched. | |
/<\/?elem>/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.parser = function(site, args) { | |
var dfr = $.Deferred(), | |
result = { | |
getPages: function() { | |
var $this = this, | |
get = $.get('../' + site + '.lsth'); | |
$.extend($this, { | |
site: site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nul (set/p _any_variable=string to emit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set rand=%random% | |
set a=0 | |
mkdir arch\%rand% | |
for /r %%i in (*bak) do ( | |
if /i not exist arch\%rand%\%%~nxi ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setlocal enabledelayedexpansion | |
for /r %%i in (*.html) do ( | |
set a=%%~nxi | |
set b=!a:~0,1! | |
if /i NOT "!b!"=="_ " ( | |
del "%%i" | |
) else ( | |
set c=%%~nxi | |
set d=!c:~1,1000! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ED = ED || {}; | |
// Utility functions | |
ED.util = (function() { | |
// Data structure functions | |
function each(object, callback) { | |
if (object === null) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I got tired of forgetting how to calculate image aspect ratio valuables, and then trying to solve the algebra, instead of actually thinking it through -- | |
// so I wrote the worlds simplest function | |
// h= current image height in pixels | |
// w= current image width | |
// nw= the width the image will be | |
// returns new height that will preserve aspect ratio at new width | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// created from this StackOverflow post: http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb | |
function rgbToHex(r,g,b){ | |
function componentToHex(c) { | |
var hex = c.toString(16); | |
return hex.length == 1 ? "0" + hex : hex; | |
} | |
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); | |
} |
OlderNewer