Skip to content

Instantly share code, notes, and snippets.

View dannylloyd's full-sized avatar

Danny Lloyd dannylloyd

  • University of Arkansas for Medical Sciences
  • Cabot, Arkansas
View GitHub Profile
@dannylloyd
dannylloyd / Read from Excel.cs
Last active December 8, 2020 20:29
Read data from Excel file using EPPLUS
var path = @"C:\Temp\Path-To-File.xlsx";
using (var pck = new OfficeOpenXml.ExcelPackage())
{
using (var stream = File.OpenRead(path))
{
pck.Load(stream);
}
var ws = pck.Workbook.Worksheets.First();
for (int rowNum = 1; rowNum <= ws.Dimension.End.Row; rowNum++)
choco install git
choco install git.install
choco install vlc
choco install putty
choco install consolez
choco install spotify
choco install winscp
choco install greenshot
choco install katmouse
choco install teamviewer
@dannylloyd
dannylloyd / ParseEnum.cs
Created September 18, 2018 13:19
How to parse an enum
//From String
var result = (EnumNameHere)Enum.Parse(typeof(EnumNameHere), stringValue);
//From Integer
var result = (EnumNameHere)integerValue;
//To Integer
var result = (int)enumValue;
//To String
var result = enumValue.ToString();
@dannylloyd
dannylloyd / Regex.txt
Created July 30, 2018 15:59
Regex Helpers
Find word inside quotes
"(.*?\b(followup)\b.*?)"
Example text: var followup = "this is a followup ";
@dannylloyd
dannylloyd / mencoder.bat
Last active May 14, 2018 14:34
Mencoder timelapse
#Run this in the directory where the images are located. Either add mencoder to path or use the full path to mencoder
"C:\DevOps\Utils\VideoUtils\mencoder.exe" -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=4/3:vbitrate=8000000 -vf scale=640:512 -o "timelapse-%DATE:/=-%@%TIME::=-%.avi" -mf type=jpeg:fps=24 mf://*.jpg
See this link
http://www.growingwiththeweb.com/2012/12/aspnet-mvc-display-and-editor-templates.html
need to add examples here
@dannylloyd
dannylloyd / GetTableRowCounts.sql
Created September 27, 2017 14:59
Gets row counts for all tables in database
CREATE TABLE #counts
(
table_name varchar(255),
row_count int
)
EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
SELECT table_name, row_count FROM #counts ORDER BY table_name, row_count DESC
DROP TABLE #counts
#http://boxstarter.org/package/nr/url?
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Never
Enable-RemoteDesktop
choco install dotnet4.5
choco install dotnet4.5.1
choco install dotnet4.5.2
choco install dotnet4.6
choco install DotNet3.5
#http://boxstarter.org/package/nr/url?
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Never
Enable-RemoteDesktop
choco install googlechrome
choco install dotnet4.5
choco install dotnet4.5.1
choco install dotnet4.5.2
choco install dotnet4.6
#http://boxstarter.org/package/nr/url?
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Never
Enable-RemoteDesktop
choco install googlechrome
choco install dotnetfx
choco install dotnet4.5
choco install dotnet4.5.1
choco install dotnet4.5.2