Skip to content

Instantly share code, notes, and snippets.

View MRdNk's full-sized avatar

Duncan Angus Wilkie MRdNk

View GitHub Profile
@MRdNk
MRdNk / WebRequest.cs
Created May 22, 2013 07:05
WebRequest C# Guide
// Guide http://msdn.microsoft.com/en-us/library/debx8sh9.aspx
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net
{
public class WebRequestPostExample
@MRdNk
MRdNk / UsingTedious.js
Created May 13, 2013 21:11
Basic Setup for using Tedious (TDS) in node.js
var Connection = require('tedious').Connection
var Request = require('tedious').Request
var TYPES = require('tedious').TYPES
var config = {
userName: 'Username'
, password: 'password'
, server: 'localhost'
}
@MRdNk
MRdNk / datepicker.setDefaults.js
Created March 20, 2013 19:12
JQuery UI DatePicker SetDefaults
(function ($) {
$.datepicker.setDefaults({
regional: 'en-GB',
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
minDate: new Date(),
yearRange: '1900:c'
});
})(jQuery);

This is a short hand...

$(function () {

});

For this...

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=779297

Error:

Bugzilla has suffered an internal error

Can't connect to the database.
Error: Can't connect to MySQL server on 'db-bugs-rw' (113)
  Is your database installed and up and running?
 Do you have the correct username and password selected in localconfig?
@MRdNk
MRdNk / IDENTITY_INSERT.sql
Created March 6, 2013 09:24
IDENTITY_INSERT example
-- SET IDENTITY_INSERT to ON.
SET IDENTITY_INSERT products ON
GO
-- Attempt to insert an explicit ID value of 3
INSERT INTO products (id, product) VALUES(3, 'garden shovel').
GO
SET IDENTITY_INSERT products OFF
@MRdNk
MRdNk / Readme.md
Last active December 14, 2015 05:48
Useful TotalMonths calculation, that extends the DateTime type.

Copy from vim to System Clipboard

:4,8!pbcopy "Copy line 4 to 8
@MRdNk
MRdNk / Graph.js
Last active December 12, 2015 12:38
Example of using gRaphael for a simple graph
$(function () {
var r = Raphael("example");
var chart = r.g.linechart (
10, 10,
490, 180,
[
[1,2,3,4,5,6,7],
[3.5,4.5,5.5,6.5,7,8]
],
[
@MRdNk
MRdNk / IsSameDate.sql
Created February 12, 2013 17:03
Checks if two DateTimes are the same Date, ignoring time.
GO
/****** Object: UserDefinedFunction [dbo].[fnIsSameDate] Script Date: 02/12/2013 17:02:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Duncan Angus Wilkie
-- Create date: 12/02/2013
-- Description: Do datetime (DATE only) match?