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 / 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");
@germ13
germ13 / syteline.md
Created April 14, 2021 15:10
syteline classes

Syteline classes

Course name	Course code	Date/Status	WaitListDate/Status
CloudSuite Industrial: Solution Overview	01_0011018_EEN3609_SYT	Completed	Completed
CloudSuite Industrial: Navigating the User Interface - Self-directed Learning	01_0012008_CEN3684_SYT	Completed	Completed
CloudSuite Industrial: Foundation - Self-directed Learning	01_0011020_CEN3630_SYT	80%	
Syteline: Administering the System	01_0011020_IEN3700_SYT	5/18/2021	None
CloudSuite Industrial: Configuring Cloud Quick Start	01_0011020_EEN3677_SYT	Self-Paced	N/A
CloudSuite Industrial: Creating Form Personalizations	01_0011018_IEN3552_SYT	None	None