Skip to content

Instantly share code, notes, and snippets.

Sean Patterson Dillie-O

Block or report user

Report or block Dillie-O

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Dillie-O
Dillie-O / drop_all_tables.sql
Created Aug 19, 2019
[Drop All Tables] Drops all tables in a given database #sql
View drop_all_tables.sql
/* Drop all Primary Key constraints */
DECLARE @name VARCHAR(128)
DECLARE @constraint VARCHAR(254)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' ORDER BY TABLE_NAME)
WHILE @name IS NOT NULL
BEGIN
SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME)
@Dillie-O
Dillie-O / drop_all_constraints.sql
Created Aug 19, 2019
[Drop All Constraints] Drop all constraints in all tables #sql
View drop_all_constraints.sql
DECLARE @dropAllConstraints NVARCHAR(MAX) = N'';
SELECT @dropAllConstraints += N'
ALTER TABLE ' + QUOTENAME(OBJECT_SCHEMA_NAME(parent_object_id))
+ '.' + QUOTENAME(OBJECT_NAME(parent_object_id)) +
' DROP CONSTRAINT ' + QUOTENAME(name) + ';'
FROM sys.foreign_keys;
EXEC sp_executesql @dropAllConstraints
@Dillie-O
Dillie-O / parse_json_into_list.cs
Created Mar 11, 2019
[Parse JSON into List] Parse JSON into List<T> #dotnetcore
View parse_json_into_list.cs
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
var pathToSeedData = Path.Combine(Directory.GetCurrentDirectory(), "Data", "duck_seed.json");
var dataSet = File.ReadAllText(pathToSeedData);
var seedData = JsonConvert.DeserializeObject<List<Duck>>(dataSet);
@Dillie-O
Dillie-O / my-gotomeeting.txt
Last active Jun 26, 2018
[My GoToMeeting] Invite text for personal GoToMeeting channel #gotomeeting #meeting #starred
View my-gotomeeting.txt
Sean's Digital Think Tank
Please join my meeting from your computer, tablet or smartphone.
https://www.gotomeet.me/Fresh-SeanPatterson
You can also dial in using your phone.
United States: +1 (571) 317-3122
Access Code: 620-705-565
@Dillie-O
Dillie-O / zsh_add_rbenv.sh
Created Jan 5, 2018
[Add rbenv to ZSH] Adds rbenv command to be accessible in ZSH (if available) #zsh #environment #configuration #ruby
View zsh_add_rbenv.sh
# load rbenv if available
if command -v rbenv >/dev/null; then
eval "$(rbenv init - zsh --no-rehash)"
fi
@Dillie-O
Dillie-O / wsl_remove_win_path_zsh.sh
Created Jan 5, 2018
[WSL Remove Win Path in ZSH] Remove windows specific path from WSL environment in ZSHRC #wsl #environment #configuration
View wsl_remove_win_path_zsh.sh
# Remove Windows paths to Ruby since it causes conflicts with npm/bower/etc.
PATH=$(echo :$PATH: | sed -e 's,:/mnt/c/tools/ruby22/bin:,:,g' -e 's/^://' -e 's/:$//')
@Dillie-O
Dillie-O / postman_environment_variable.js
Created Jan 2, 2018
[Postman Environment Variable Update] Updates environment variable in Postman. Use in 'Tests' section. #postman #api #environment
View postman_environment_variable.js
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable('token', jsonData.data.JWT);
@Dillie-O
Dillie-O / find_tables_with_column.sql
Created Oct 17, 2017
[Find Tables with Column] Finds all tables with column names matching input #sql
View find_tables_with_column.sql
SELECT c.name AS ColName, t.name AS TableName
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyCol%';
@Dillie-O
Dillie-O / Convert_SSL_Certificate.sh
Created Sep 14, 2017
[Convert SSL Cerfiticate CER to PFX] Convert SSL Certificate for Azure Use #ssl #cer #pfx #pkcs7 #pkcs12
View Convert_SSL_Certificate.sh
openssl pkcs12 -export -out final_name.pfx -inkey private_key.key -in original_certificate.crt
@Dillie-O
Dillie-O / azure_specify_build
Last active Jul 20, 2017
[Azure Specify Build] Specify specific build config for deployment #azure #deployment #configuration
View azure_specify_build
In the Application settings, add the following key/value pair
Key: SCM_BUILD_ARGS
Value: -p:Configuration=Debug
You can’t perform that action at this time.