Skip to content

Instantly share code, notes, and snippets.

View perfectly-panda's full-sized avatar

PerfectlyPanda perfectly-panda

View GitHub Profile
// Original JavaScript code by Chirp Internet: chirpinternet.eu
// Please acknowledge use of this code by including this header.
class MazeBuilder {
constructor(width, height) {
this.width = width;
this.height = height;
@perfectly-panda
perfectly-panda / gist:fe9d97e5d582be355cd6aacbdbcc7228
Last active June 12, 2018 18:43
Auto Create External Table
/****** Object: StoredProcedure [dbo].[sp_Get_Product_Temps] Script Date: 6/12/2018 1:13:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Samara Duncan
-- Create date: June 12, 2018
@perfectly-panda
perfectly-panda / gist:df20b0bf94ddb0a7e6941026b29839a0
Created August 31, 2017 19:40
Create External Table (Azure SQL)
//nothing special here, I just got tired of digging this up from MSDN
CREATE EXTERNAL TABLE [dbo].[all_dm_exec_requests](
[session_id] smallint NOT NULL,
[request_id] int NOT NULL,
[start_time] datetime NOT NULL,
[status] nvarchar(30) NOT NULL,
[command] nvarchar(32) NOT NULL,
[sql_handle] varbinary(64),
[statement_start_offset] int,
@perfectly-panda
perfectly-panda / gist:e41a3da38f55d8ebc047cd1b953c0ad3
Last active December 1, 2016 16:39
Insert into a DB using a USQL outputter
[SqlUserDefinedOutputter]
public class ExternalDatabase : IOutputter
{
private static string ConnectionString = "YOUR CONNECTION STRING";
public override void Output(IRow row, IUnstructuredWriter output)
{
using (System.Data.SqlClient.SqlConnection sqlConnection1 =
new System.Data.SqlClient.SqlConnection(ConnectionString))
@perfectly-panda
perfectly-panda / USQL CSVExtractor
Last active May 19, 2018 18:49
Use column names to map csv file to extract columns
using Microsoft.Analytics.Interfaces;
using Microsoft.Analytics.Types.Sql;
using Microsoft.VisualBasic.FileIO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;