Skip to content

Instantly share code, notes, and snippets.

View Dillie-O's full-sized avatar

Sean Patterson Dillie-O

View GitHub Profile
@Dillie-O
Dillie-O / azure_specify_build
Last active July 20, 2017 17:34
[Azure Specify Build] Specify specific build config for deployment #azure #deployment #configuration
In the Application settings, add the following key/value pair
Key: SCM_BUILD_ARGS
Value: -p:Configuration=Debug
@Dillie-O
Dillie-O / azure_project_deploy.txt
Created July 20, 2017 17:32
[Azure Specify Project] Specify specific project for deployment #azure #deployment #configuration
In the Application settings add the following key/value pair
Key: Project
Value: webui/webui.csproj
@Dillie-O
Dillie-O / dti_documentation_local.sh
Created July 3, 2017 16:36
[Build DTI Documentation] WSL build command to help with paths #dti #build #apiary #hercule
hercule main.apib -o apiary.apib && apiary preview --output=/mnt/c/Users/dilli/Projects/apiary-preview.html
@Dillie-O
Dillie-O / remove_path_values.sh
Created June 26, 2017 17:40
[Remove path values] Remove instances of a directory from PATH #zsh #bash #shell
# Replace `/mnt/c/tools/ruby22/bin` with your path. Additional syntax used so that you don't have to escape path.
PATH=$(echo :$PATH: | sed -e 's,:/mnt/c/tools/ruby22/bin:,:,g' -e 's/^://' -e 's/:$//')
@Dillie-O
Dillie-O / sql_reset_autoincrement.sql
Created May 24, 2017 14:40
[Reset AutoIncrement Seed] Resets autoincrement column to value needed #tags:sql
DBCC CHECKIDENT (TABLE_NAME, RESEED, 0)
@Dillie-O
Dillie-O / ef_migrate_different_database.ps1
Created May 24, 2017 14:39
[Run Migration Against Different Database] Allows you to run EF migration and target a different database. Handy when automatic migrations cause issue on remove server #tags:ef,migration,sql
Update-Database -ConnectionString "MY_CONNECTION_STRING" -ConnectionProviderName "System.Data.SqlClient"
@Dillie-O
Dillie-O / sql_search_column_name.sql
Created May 24, 2017 14:36
[Search Database for Column Name] Searches entire database for column name. Can use wildcards #tag:sql
SELECT * FROM information_schema.COLUMNS WHERE column_name like '%[Column_Name]%'
@Dillie-O
Dillie-O / sql_get_foreign_keys_referencing_table.sql
Created May 24, 2017 14:34
[Get Foreign Keys Referencing a Table] Inverse of getting foreign keys for a table #tags:sql
EXEC sp_fkeys @fktable_name='[Table_Name]'
@Dillie-O
Dillie-O / sql_get_foreign_keys.sql
Created May 24, 2017 14:33
[Get Foreign Keys] Get foreign keys for a table #tags:sql
EXEC sp_fkeys '[Table_Name]'
@Dillie-O
Dillie-O / mysql_seed_random_number.sql
Created May 24, 2017 14:31
[Seed Random Data] Inserts random number range into table column #tags:mysql
drop procedure if exists load_foo_test_data;
delimiter #
create procedure load_foo_test_data()
begin
declare v_max int unsigned default 10;
declare v_counter int unsigned default 1;
declare v_min_rand int unsigned default 1;
declare v_max_rand int unsigned default 1;