Skip to content

Instantly share code, notes, and snippets.

View FUNC_Pad.sql
-- ======================================================================================
-- Author: Adam Nofsinger
-- Created: 2013-04-29
-- Description: Utility to return an integer number as a string, padded to X many chars
-- with zeros to the left of the number. E.g. Pad(45, 5) = '00045'
-- ======================================================================================
CREATE FUNCTION [dbo].[Pad] (
@num integer,
@len integer = 3
) RETURNS varchar(100)
View maptiles_concat.sh
# original idea from http://gis.stackexchange.com/questions/73946/automatically-download-and-merge-webmap-tiles-into-one-big-image
# pre-requisite: imagemagick
# ( e.g. sudo apt-get imagemagick )
X1=0
Y1=0
X2=9
Y2=13
Z=4
for x in `seq $X1 $X2`; do
@adamnoffie
adamnoffie / Cleanup_FilesByAge.ps1
Created Nov 23, 2015
Recursively Clean up Files/Folders in a directory by the Modified Date (Age) of File
View Cleanup_FilesByAge.ps1
# Function that deletes any files, recursively, from a directory that are older than X days for modified day.
# this is mostly stolen from http://stackoverflow.com/a/19326146/18524
function Cleanup-Dir
{
param([string]$path, [int]$limit)
$minDay = (Get-Date).AddDays(-1 * $limit)
# delete files older than $limit
Get-ChildItem -Path $path -Recurse -Force `
View whats_this_do.js
// what does this do?:
(function(){
var i = 5;
}());
// is it like a javascript hack equivalent to the jQuery(document).ready()? e.g.:
$(function() {
View TargetsToLeads.php
<html>
<head>
<title>ProspectToLead - Campaign</title>
<style type="text/css">
body { font-family: Consolas, Monaco, Courier New, Courier }
.error { color: red; font-weight: bold }
.finished { color: green; font-size: larger }
</style>
</head>
<body style="width: 1000em">