Skip to content

Instantly share code, notes, and snippets.

View germ13's full-sized avatar

juan serrano germ13

  • east los angeles
View GitHub Profile
@germ13
germ13 / ett_mapping.vb
Last active April 17, 2025 16:27
map one csv to another csv rearranging headers and renaming
Imports System
Imports System.IO
Module Program
Sub Main(args As String())
' Read the input file
Dim inputFilePath As String = "testResults.txt"
Dim inputLine As String = File.ReadAllText(inputFilePath).Trim()
' Parse the input line into a list of entries, removing double quotes
<!DOCTYPE html>
<html lang="en" data-theme="cupcake">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/daisyui.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
@germ13
germ13 / entityFrameworkScaffolding.ps1
Created November 7, 2023 18:46
entity framework scaffolding
# scaffold database
dotnet ef dbcontext scaffold "Server=DESKTOP-2Q3OQ0V;Database=ProductionTracking;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o Models -c ProductionTrackingContext --context-dir Contexts -f
# add Microsoft.EntityFrameworkCore.Design to project (data access project
dotnet add package Microsoft.EntityFrameworkCore.Design
@germ13
germ13 / dictionary_traversal.py
Created October 18, 2023 20:55
Python dictionary traversal given path array
from functools import reduce
import operator
# 4bb
k = ["a", "b", "c", "d"]
ar = {}
ar["a"] = {}
ar["a"]["b"] = {}
ar["a"]["b"]["c"] = {}
@germ13
germ13 / GenerateTSQLForDeltaTable.sql
Last active October 18, 2022 06:05
Display difference in data between two exact schema tables.
ALTER PROCEDURE [dbo].[GenerateTSQLForDeltaTable] AS
BEGIN
DECLARE @tables TABLE (tableschema nvarchar(16), tablename nvarchar(36), columnname nvarchar(64));
declare @staticDB nvarchar(32) = 'DeltaA';
declare @LiveDb nvarchar(32) = 'DeltaB';
insert into @tables
@germ13
germ13 / FixWindowsUpdate.bat
Last active September 29, 2022 16:31
Fix Stuck Windows Updates
@ECHO OFF echo This script is intended to stop fix broken windows updates
REM Changing folder and file permissions for locked files
attrib -h -r -s %windir%\system32\catroot2
attrib -h -r -s %windir%\system32\catroot2\*.*
REM Stopping services that lock relevant files
net stop wuauserv
net stop CryptSvc
@germ13
germ13 / DeltaTable01.sql
Last active July 28, 2022 17:15
Delta for SQL
USE [DeltaA]
GO
/****** Object: StoredProcedure [dbo].[DeltaTable01] Script Date: 7/28/2022 1:26:02 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[DeltaTable01] (
@table nvarchar(100)
, @PK_Column nvarchar(32) = 'Id'
@germ13
germ13 / NewtonFractal.cs
Created October 11, 2021 06:40 — forked from kjellski/NewtonFractal.cs
LinqPad Compatible Fractal Drawing
/* Idea and clojure from http://nakkaya.com/2010/04/20/fractals-in-clojure-newton-fractal */
Func<Complex, Complex> f1 = c => (c * c * c) - Complex.One;
Func<Complex, Complex> f2 = c => ((c * c * c) - (c * 2)) + 2;
Func<Complex, Complex> f3 = c => new Complex(Math.Sin(c.Real) * Math.Cosh(c.Imaginary),
Math.Cos(c.Real) * Math.Sinh(c.Imaginary));
Func<Complex, Complex> f4 = c => (c * c * c * c) - Complex.One;
double step = 0.000006;
double delta = 0.003;
Tuple<int,int> formDimensions = new Tuple<int,int>(800, 600);
@germ13
germ13 / Create-CRUD-MVC.ps1
Created September 7, 2021 07:07
Create controllers and views
$_solution="SHCA09";
$_mvcProject="SHCA.Web";
$_apiProject="SHCA.Api";
$_dbProject="SHCA.Entity";
$_sdk_version="5.0.303";
$_dbName="Automatic"
$_dbModelFolder="Models"
## Install Install code generator:
@germ13
germ13 / Startup.cs
Last active August 19, 2021 02:11
Boilerplate Startup.cs for dotnet web project
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
else
{
app.UseExceptionHandler("/Error");