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 / mysql_list_tables.sql
Last active May 24, 2017 14:18
[Get List of Tables] Get list of tables in a database #tags: mysql
SELECT DISTINCT table_name
FROM information_schema.columns
WHERE table_schema = dbname;
@Dillie-O
Dillie-O / dvs.txt
Created December 13, 2016 15:38
Daily Virtual Standup E-mail Template (DVS)
Yesterday
[:: Client ::] - Task
Today
[:: Client ::] - Task
Roadblocks
... none ...
Questions
@Dillie-O
Dillie-O / get_all_media.ps1
Created October 20, 2016 22:57
PowerShell script to iterate all containers and blobs in a storage account and download it.
$destination_path = 'C:\Users\dilli\Downloads\media_dump'
$connection_string = '[AZURE_STORAGE_CONNECTION_STRING]'
$storage_account = New-AzureStorageContext -ConnectionString $connection_string
$containers = Get-AzureStorageContainer -Context $storage_account
Write-Host 'Starting Storage Dump...'
foreach ($container in $containers)
@Dillie-O
Dillie-O / OctalPiRemix.txt
Created March 15, 2016 23:14
Sonic Pi Octal Conversion
# Strip . from Pi
piValue = "3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609"
piOctal = piValue.to_i(10).to_s(8)
piArrayRaw = piOctal.to_s.split(//)
piDigits = piArrayRaw.size
print "PI: " << piValue << "\n"
print "PI Octal: " << String(piOctal) << "\n"
print "PI Digit Count: " << String(piDigits) << "\n"
@Dillie-O
Dillie-O / decatonicpi.txt
Last active March 15, 2016 23:50
Sonic Pi code file for playing a Pi melody on a decatonic scale
# Sonic Pi synth file (with notes) for generating music
# on a decatonic scale with pi as the "melody"
#
# https://en.wikipedia.org/wiki/Piano_key_frequencies
# Middle C (C4) - 261 HZ
# High C (C5) - 523HZ
# Computing major notes in scale:
#
# (523-261) / 8 = 32.75 HZ between notes
# D = 261+32.75 = 293.75 HZ
@Dillie-O
Dillie-O / terminal_snow.sh
Created December 10, 2015 13:15
Run this script in the OS X terminal window to have some digital "snow"
ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S=["2743".to_i(16)].pack("U*");a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.1}'
@Dillie-O
Dillie-O / sequential-random-tablefill.sql
Created November 4, 2015 12:49
Fill a table sequentially with random data
drop procedure if exists load_table_test_data;
delimiter #
create procedure load_table_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 6;
@Dillie-O
Dillie-O / Microsoft.PowerShell_profile.ps1
Last active October 20, 2015 13:18
PowerShell script to load SSH Agent Utils and PoshGit
# Update path for SSH (Loaded in PowerShell Profile)
$env:path += ";" + (Get-Item "Env:ProgramFiles").Value + "\Git\bin"
$env:path += ";" + (Get-Item "Env:ProgramFiles").Value + "\Git\usr\bin"
# Load SSH agent utils
. (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)
# Spoof terminal environment for git color.
$env:TERM = 'cygwin'
@Dillie-O
Dillie-O / gist:d9b2b0cbcdda385e44c5
Created August 3, 2015 18:50
Sitefinity Load Custom Scripts Only in Designer Mode
<script language="C#" runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
if (!Telerik.Sitefinity.Services.SystemManager.IsDesignMode)
{
var scriptManager = System.Web.UI.ScriptManager.GetCurrent(Page);
if (scriptManager == null) return;
scriptManager.Scripts.Add(new ScriptReference { Path = "https://maps.googleapis.com/maps/api/js?key=AIzaSyA2OGXl_YKdtBFvOSb7sxyGvf9ePBaipSA&v=3.exp&sensor=false" });
@Dillie-O
Dillie-O / gist:83e74e2ba6505849fe44
Created August 3, 2015 18:47
Sitefinity RadScriptManager Before
<telerik:RadScriptManager ID="RadScriptManager1" CompositeScript-ScriptMode="Release" EnableScriptGlobalization="True" EnableScriptLocalization="False" runat="server" CompositeScript-NotifyScriptLoaded="True" LoadScriptsBeforeUI="True" OutputCompression="Forced" AjaxFrameworkMode="Disabled">
<CompositeScript>
<Scripts>
<asp:ScriptReference Name="Telerik.Sitefinity.Resources.Scripts.jquery-1.11.2.min.js" Assembly="Telerik.Sitefinity.Resources" />
<asp:ScriptReference Name="Telerik.Sitefinity.Resources.Scripts.MicrosoftAjax.js" Assembly="Telerik.Sitefinity.Resources" />
<asp:ScriptReference Name="Telerik.Sitefinity.Resources.Scripts.MicrosoftAjaxWebForms.js" Assembly="Telerik.Sitefinity.Resources" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" />
<asp:ScriptReference Name=“Telerik.Sitefinity.Resources.Scripts.Kendo.kendo.web.min.js" Assembly="Telerik.Sitefinity.Resources" />
<asp:ScriptReference Path="~/App_Data/Sitefinity/WebsiteTemplates/WAFD/js/vend