Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
davidvanvickle / numbers-and-commas.htm
Created August 8, 2012 18:48
js - only numbers and commas
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>only numbers and commas</title>
</head>
@davidvanvickle
davidvanvickle / urlencode.js
Created July 25, 2012 00:50
JS urlencode
function URLEncode (clearString) {
var output = '';
var x = 0;
clearString = clearString.toString();
var regex = /(^[a-zA-Z0-9_.]*)/;
while (x < clearString.length) {
var match = regex.exec(clearString.substr(x));
if (match != null && match.length > 1 && match[1] != '') {
output += match[1];
x += match[1].length;
@davidvanvickle
davidvanvickle / activate-on-date.asp
Created July 24, 2012 21:04
vbscript asp activate on date
' activate on this day
if datediff("d",now,cdate("09-Dec-2010 00:00:00")) <= 0 then
%>activated<%
end if
' activate at this time
if datediff("n",now,cdate("30-Dec-2010 17:00:00")) <= 0 then
%>activated<%
end if
Parse this (some.xml):
<root><xline a="1" b="2" /><xline a="3" b="4" /></root>
With this:
<div id="parsed">Loading...</div>
@davidvanvickle
davidvanvickle / js-add-commas.htm
Created June 28, 2012 21:41
JS - put commas in dollar amount
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Add commas</title>
</head>
@davidvanvickle
davidvanvickle / alphanum.htm
Created June 19, 2012 18:42
JS - only letters and numbers
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>only letters and numbers</title>
</head>
# rsync notes
# TRY WITH TEST ACCOUNTS FIRST
# based on
# http://www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html
# -------
http://www.howtogeek.com/115051/become-a-vi-master-by-learning-these-30-key-bindings/
Mode Switching
As a short recap, vi is a modal editor – there’s an insert mode and a standard command mode. In insert mode, vi functions similar to a normal text editor. In command mode, you take advantage of these key bindings.
i – Enter insert mode.
Escape – Leave insert mode. If you’re already in command mode, Escape does nothing, so you can press Escape to ensure you’re in command mode.
Moving the Cursor
Vi uses the hjkl keys to move the cursor in command mode. Early computer systems didn’t always have arrow keys, so these keys were used instead. One advantage of these keyboard shortcuts is that you don’t have to move your fingers from the home row to use them.
@davidvanvickle
davidvanvickle / remove-exif.sh
Created May 17, 2012 20:24
Remove EXIF data from JPG
# show EXIF data
exiftool image.jpg
# first install exiftool, then use "-All=" to wipe all EXIF data from JPG
# this will modify image.jpg and create backup file image.jpg_original
exiftool -All= image.jpg
@davidvanvickle
davidvanvickle / ascii.sh
Created April 13, 2012 05:41
convert file to ascii
# see man page, args may vary
# to force conversion, use -c also
iconv -t ISO-8859-1 -f UTF-8 < utf.txt > asc.txt