Skip to content

Instantly share code, notes, and snippets.

View jondlm's full-sized avatar

Jon de la Motte jondlm

  • Stripe
  • Portland, OR
View GitHub Profile
@jondlm
jondlm / index.js
Created January 28, 2015 21:07
requirebin sketch
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
var rows = [
{data: 'hello'},
{data: 'there'},
{data: 'friend.'}
];
@jondlm
jondlm / swe.md
Last active August 29, 2015 14:22
Basics of web development
@jondlm
jondlm / functions.js
Last active August 29, 2015 14:23
Functions
// -------------------------------------
// Example 1 (function expression)
//
test(); // Won't work
var test = function () {
alert('Yolo');
};
@jondlm
jondlm / good-examples.js
Created July 4, 2015 22:18
Good logging examples
data: {
"event": "response",
"timestamp": 1436046421423,
"id": "1436046421423:jdelamotte:5282:ibpkyk17:10001",
"instance": "http://jdelamotte:8888",
"labels": [],
"method": "get",
"path": "/js/bundle.js",
"query": {},
"responseTime": 8,
// Make sure you have a `bundle.js` file in the current dir and run this like:
// # go run webpack_bundle_analysis.go | sort -n
package main
import (
"fmt"
"io/ioutil"
"regexp"
"strings"
@jondlm
jondlm / UnknownRecord.sql
Last active December 14, 2015 17:19
A TSQL helper stored proc to generate and insert your unknown records for you. Be sure to modify and test the stored proc before implementing it. It can be tested by not supplying the third @action parameter, and it can be executed by specifying a third @action parameter of ‘runit’. Credit to http://www.bidn.com/blogs/PatrickLeBlanc/ssis/745/ins…
-- author: jond@csgpro.com
-- create: 2013-03-08
-- description: this proc will take table name, schema name, and optional action parameters
-- and insert an "unknown" record into that dimension table for you. If you don't
-- specific the @Action parameter as 'runit', then it will only print the SQL
-- output for you.
create proc [helper].[UnknownRow]
@TableName sysname,
@TableSchema sysname = 'dbo',
@jondlm
jondlm / CompareTableColumns.sql
Created March 28, 2013 23:35
A TSQL helper stored proc for comparing the column names of two tables.
-- =============================================
-- Author: Jon - jond@csgpro.com
-- Create date: 2013-03-05
-- Description: Helper function for comparing columns between two tables.
-- =============================================
CREATE FUNCTION [helper].[fnCompareTableColumns] (
@baseTable varchar(250),
@compareTable varchar(250)
)
RETURNS TABLE
@jondlm
jondlm / Execute Sql Agent Job.ps1
Last active December 20, 2015 09:30
A small script to kick off a SQL agent job on SQL Server.
Write-Host "Loading connection..." -ForegroundColor Yellow -NoNewline
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
Write-Host "Done." -ForegroundColor Green
#Set the connection string
$SqlConnection.ConnectionString = "Server=,<server name>;Database=<database name>;Integrated Security=True"
#Declare a SqlCommand object
$SqlCommand = New-Object System.Data.SqlClient.SqlCommand
@jondlm
jondlm / jslint-header.js
Created September 16, 2013 19:11
Node / browserify / jQuery jslint header
/*jslint
browser: true,
node: true */
/*global $ */
@jondlm
jondlm / sql-server_row-count-and-size.sql
Last active December 28, 2015 03:49
Some general scripts for SQL Server to get a data about tables in your databases
USE DatabaseName
GO
CREATE TABLE #temp_table (
table_name sysname ,
row_count INT,
reserved_size VARCHAR(50),
data_size VARCHAR(50),
index_size VARCHAR(50),
unused_size VARCHAR(50))