Skip to content

Instantly share code, notes, and snippets.

View dredix's full-sized avatar

Leonardo Cortez dredix

  • Sydney, Australia
View GitHub Profile
@dredix
dredix / UpdateDDNS.ps1
Created August 29, 2012 07:50
A PowerShell script for performing a Dynamic DNS Update with namecheap.com
# UpdateDDNS.ps1
# Update Dynamic DNS on Namecheap.com via HTTP GET request.
Param(
[parameter(Mandatory=$true)]
[alias("c")]
$ConfigFile)
# Parse the content of an INI file, return a hash with values.
# Source: Artem Tikhomirov. http://stackoverflow.com/a/422529
Function Parse-IniFile ($file) {
@dredix
dredix / Thumbinate.cs
Created July 23, 2012 07:34
A C# console program that creates square 150x150 thumbnails for all the images in a given folder, preserving the directory structure
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
namespace Thumbinate
{
class Program
{
@dredix
dredix / tumblr_e417_html_template
Created January 31, 2012 10:54
A custom html template for Tumblr (with a Twitter widget and a list of Github repositories)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
Designed by
_|_|_| _|_| _|_|_|_| _|_| _| _|_|
_| _| _|_|_|_| _| _|_|_|_| _|_|
_| _| _| _| _| _|
_|_|_| _|_|_| _|_| _|_|_| _|
@dredix
dredix / hgcopy.cmd
Created January 20, 2012 03:44
Copy the files added and modified since the last commit from a mercurial repository to the target directory.
REM HGCOPY: Copy the files added and modified since the last
REM commit from a mercurial repository to the target directory.
REM Syntax: hgcopy [dest_path]
@echo off
if [%1]==[] goto:Syntax
REM Only copy added and modified files.
for /F "" %%I in ('hg st -man') do call :Copyfile %%I %1\%%I