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
#!/bin/sh | |
# 404-check.sh - Script to test for 404s | |
# author: lkptrzk | |
# Usage: | |
# Assuming a file named 'input' with one URL per line | |
# the following command will output which files were 404s: | |
# cat input | xargs 404-check.sh |
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
#!/bin/sh | |
# get-http-status-codes.sh - Gets HTTP status codes for a list of URLs | |
# Usage: | |
# Assuming a file named 'input' with one URL per line | |
# the following command will output the HTTP status code, | |
# a space, and the URL for each line of input | |
# cat input | xargs get-http-status-codes.sh |
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
/* | |
|| T-SQL script to generate pretty SELECTs to start researching an undocumented SQL Server database | |
*/ | |
declare @crlf varchar(2); | |
set @crlf = CHAR(13); /* crlf is really CHAR(10)+CHAR(13) but doesn't print right in messages window */ | |
declare @query_catalog nvarchar(50), | |
@query_schema nvarchar(50), | |
@query_table nvarchar(50), |
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 setWidthInChars(selector, numChars) { | |
$('body').append('<div id="testwidth"><span> </span></div>'); | |
var w = $('#testwidth span').width(); | |
alert(w); | |
$('#testwidth').remove(); | |
$(selector).css('width', (w * numChars + 1) + 'px'); /* +1 is for rounding problems */ | |
} |
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
#!/bin/sh | |
# man.sh - `man` replacement for git bash on windows | |
# Dependencies (outside of git bash): | |
# wget (http://users.ugent.be/~bpuype/wget/) | |
# TODO: | |
# use sed to remove <head> & tags, convert HTML entities |
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 binary_search(arr, search_term, min, max) { | |
if (max < min) return -1; | |
var i = Math.floor((min + max) / 2), | |
curr_term = arr[i]; | |
if (curr_term === search_term) { | |
return i; | |
} else if (curr_term < search_term) { | |
return binary_search(arr, search_term, min, i - 1); | |
} else if (curr_term > search_term) { | |
return binary_search(arr, search_term, i + 1, max); |
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 http = require('http'), | |
util = require('util'), | |
url = require('url'); | |
var handlers = {}; | |
handlers.homepage = function (request, response) { | |
response.writeHead(200, { 'Content-type': 'text/plain' }); | |
response.write('homepage goes here.'); | |
}; |
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
$._data($('#someid')[0]).events |
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
#!/bin/bash | |
COUNT=$1 | |
EXPLETIVE=$2 | |
yes $EXPLETIVE | tr -d '\n' | head -c $COUNT |
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
#!/bin/bash | |
COUNT=$1 | |
cat /dev/urandom | head -c $COUNT |
OlderNewer