Skip to content

Instantly share code, notes, and snippets.

@dirq
dirq / CheckObjectExistenceSqlServer.sql
Created May 13, 2022 20:36
Examples for checking if SQL Server Objects exist
/*
CHECK FOR OBJECTS IN MS SQL SERVER
Examples of how to check for existing objects in SQL Server.
Use them before you drop/create/modify to avoid errors.
*/
--Column Check
--Using INFORMATION_SCHEMA.COLUMNS
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS
@dirq
dirq / website-performance-test.ps1
Created February 16, 2022 00:08
Script to run Lighthouse CLI performance tests
# install nodejs
# run npm i -g lighthouse
# open powershell to folder where you saved this file
# use like:
# .testsite mycogen.com
Param (
$url
)
$timestamp = Get-Date -Format yyyymmdd-hhmmss
@dirq
dirq / PrinterMarks.cs
Created August 27, 2018 16:47
Adding printer marks with Aspose.Pdf
using System;
using System.Collections.Generic;
//tested using Aspose.Pdf 18.8.0
using Aspose.Pdf;
using Aspose.Pdf.Drawing;
namespace Dirq.DocBuilder.Rendering
{
public static class PrinterMarks
{
@dirq
dirq / WebstormJavaScriptCodeTemplate
Created February 18, 2015 21:47
Webstorm Code Template - New JavaScript File with Closure
#set( $className = "$NAME.substring(0,1).toLowerCase()$NAME.substring(1)" )
/**
* Created by ${USER} on ${DATE}.
*/
var ${className} = (function () {
'use strict';
var self = {},
debug = true;
@dirq
dirq / JavaScript Closure IFFY
Last active August 29, 2015 14:15
JavaScript Closure IFFY Module
var app = (function ()
{
'use strict';
var self = {},
debug = true;
function log(msg)
{
if (debug && console && console.log)
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';