Skip to content

Instantly share code, notes, and snippets.

View hur1can3's full-sized avatar

Matthew Levandowski hur1can3

  • Grand Rapids, MI
View GitHub Profile
@hur1can3
hur1can3 / progressknight2-mobile.html
Created June 6, 2025 20:07
Progress Knight 2 - Preact/HTM mobile version
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="3dRpUi_nCRUylR6q1QmELb0AKrQNCdo17cBgOOSTmSc" />
<title>Progress Knight 2.0 - Preact/HTM Version</title>
<link rel="shortcut icon" href="https://placehold.co/16x16/000000/FFFFFF?text=PK" />
<script type="importmap">
@hur1can3
hur1can3 / main.js
Created August 19, 2021 20:07
Vue 2 dynamically import components and pass props from script json or html data attributes
import Vue from 'vue';
if (process.env.NODE_ENV === "development") {
Vue.config.devtools = true;
} else {
Vue.config.devtools = false;
}
// import App from './App.vue'
@hur1can3
hur1can3 / GenerateEfCoreMigrationSeedData.cs
Created December 10, 2020 19:10
Generation Ef Core Migration Builder Has Data Seed Data initializer from exsiting data in dbcontext
// If data already existins in dbcontext tables it Returns Migration Builder Seed data in form of string containing initialers to modulBuilder.Entity
#r "nuget:Microsoft.EntityFrameworkCore.SqlServer/5.0.1"
#r "nuget:Microsoft.EntityFrameworkCore/5.0.1"
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.SqlServer;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@hur1can3
hur1can3 / generatepocos.sql
Created April 6, 2020 18:45
TSQL create pocos for tables with annotations for length and nullable types
DECLARE @tableName VARCHAR(200);
DECLARE @columnName VARCHAR(200);
DECLARE @nullable VARCHAR(50);
DECLARE @datatype VARCHAR(50);
DECLARE @nullableSign VARCHAR(10);
DECLARE @columnType VARCHAR(200);
DECLARE @maxlen INT;
DECLARE @sType VARCHAR(50);
DECLARE @sProperty VARCHAR(200);
@hur1can3
hur1can3 / TSQL-to-POCO.sql
Last active February 28, 2018 18:25 — forked from plaisted/TSQL-to-POCO.sql
Modified original GIST to accommodate c# nullable types (?). And also come from a #temptable. Use lowercase for primitive types.
if object_id('tempdb..#TempTableClassName') is not null
drop table #TempTableClassName
SELECT TOP 1 *
INTO #TempTableClassName
FROM table
WHERE id = 1;
declare @TempTable VARCHAR(255)= '#TempTableClassName%';
declare @tableName varchar(200)
import pandas as pd
import random
import numpy as np
import simplejson
import urllib
import time
from jinja2 import Template
from itertools import combinations
apikey = "YOUR KEY HERE"
#!/usr/bin/env python
# filename: shrinkpdf
# description: A Python wrapper for the gs command, to reduce the filesize of PDFs
# fileversion: 0.2.1
# date: 20130506
# author: Dayo Adewunmi, Matthew Levandowski
# email: [email protected]
# license: GPLv3
# python version: 2.7.3
@hur1can3
hur1can3 / LatestFiles.vba
Created November 22, 2013 14:43
Grab all of the latest files based on the current date and time of the file
Public Function LatestFiles(ByRef MyPath As String, ByRef MyFileExtension as String) As Variant
'Declare the variables
Dim MyFile As String
Dim LatestFile As String
Dim LatestDate As Date
Dim LMD As Date
Dim OldDate As Date
Dim Now As Date
Dim FileList() As Variant
@hur1can3
hur1can3 / generic-sp-history.sql
Created November 22, 2013 14:23
TSQL Stored Procedures with history tables for parameters. Say you have a stored procedure that pulls huge amounts of data into a temp table that it returns on a regular basis. This stored procedure also uses parameters from the previous run query (i.e. dates from previous run) to calculate it's values in the current query. Well by storing the p…
USE [DBName]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@hur1can3
hur1can3 / twitterpuddles.py
Created November 22, 2013 14:06
I Failed a twitter interview http://qandwhat.apps.runkite.com/i-failed-a-twitter-interview/ python solution modification
import numpy as np
from matplotlib import pyplot as plt
import random
import itertools
# ground = [2, 5, 1, 3, 1, 2, 1, 7, 6] # data
#ground = [2, 5, 1, 3, 1, 2, 1, 7, 6, 3, 1, 3]
ground = []
solutions = [10, 17, 18, 0, 20, 20, 39, 42, 0, 0, 17, 25,