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 / parse_json_into_list.cs
Created March 11, 2019 23:52
[Parse JSON into List] Parse JSON into List<T> #dotnetcore
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 / zsh_add_rbenv.sh
Created January 5, 2018 16:33
[Add rbenv to ZSH] Adds rbenv command to be accessible in ZSH (if available) #zsh #environment #configuration #ruby
# 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 January 5, 2018 16:29
[WSL Remove Win Path in ZSH] Remove windows specific path from WSL environment in ZSHRC #wsl #environment #configuration
# 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 January 2, 2018 14:41
[Postman Environment Variable Update] Updates environment variable in Postman. Use in 'Tests' section. #postman #api #environment
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable('token', jsonData.data.JWT);
@Dillie-O
Dillie-O / find_tables_with_column.sql
Created October 17, 2017 23:53
[Find Tables with Column] Finds all tables with column names matching input #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 September 14, 2017 20:17
[Convert SSL Cerfiticate CER to PFX] Convert SSL Certificate for Azure Use #ssl #cer #pfx #pkcs7 #pkcs12
openssl pkcs12 -export -out final_name.pfx -inkey private_key.key -in original_certificate.crt
@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/:$//')