This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://superuser.com/a/1511657/71857 | |
ffmpeg -list_devices true -f dshow -i dummy -hide_banner | |
#[dshow @ 0000022fd7ac8440] DirectShow video devices (some may be both video and audio devices) | |
#[dshow @ 0000022fd7ac8440] "USB 2.0 CAMERA" | |
ffmpeg -f dshow -show_video_device_dialog true -i video="USB 2.0 CAMERA" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string CalcHMACSHA256Hash(string plaintext, string salt) | |
{ | |
string result = ""; | |
var enc = Encoding.Default; | |
byte[] baText2BeHashed = enc.GetBytes(plaintext), | |
baSalt = enc.GetBytes(salt); | |
System.Security.Cryptography.HMACSHA256 hasher = new HMACSHA256(baSalt); | |
byte[] baHashedText = hasher.ComputeHash(baText2BeHashed); | |
result = string.Join("", baHashedText.ToList().Select(b => b.ToString("x2")).ToArray()); | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Extensions | |
{ | |
public static string PadRight(this string input, int totalWidth, string paddingString){ | |
var rep = string.Concat(Enumerable.Repeat(paddingString, totalWidth-input.Length)); | |
return (input + rep); | |
} | |
public static string PadLeft(this string input, int totalWidth, string paddingString){ | |
var rep = string.Concat(Enumerable.Repeat(paddingString, totalWidth-input.Length)); | |
return (rep + input); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://stackoverflow.com/a/46571396/618186 | |
fsutil file createnew [filename].[extension] [# of bytes] | |
fsutil file createnew asdf.pdf 6234214 #6mb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query user /server:computername |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$.get('https://google.com', function(data) { | |
console.log(data); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool DateWithinSqlParameters(Event model, DateTime? date, PropertyValidatorContext context) | |
{ | |
var maxDate = DateTime.Today.AddYears(30); | |
context.Rule.MessageBuilder = c=> $"Invalid date entered for {context.PropertyDescription}. Must be between 1/1/2000 - {maxDate.ToString("M/d/yyyy")}"; | |
return !date.HasValue || (date.Value >= new DateTime(2000,1,1) && date.Value <= maxDate); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#FF353C Dark Salmon, red, highlighting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Cut/Edit video | |
# input file start end output file | |
#ffmpeg -i inputfilename.mp4 -ss 00:00:03 -t 00:00:08 -async 1 outputfilename.mp4 | |
#Combine videos into single file | |
# pathToVideos | |
for f in Videos/*; do echo "file '$f'"; done >> files.txt | |
./ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4 | |
rm files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var pck = new OfficeOpenXml.ExcelPackage()) | |
{ | |
var ws = pck.Workbook.Worksheets.Add("Sheet1"); | |
ws.Cells.LoadFromCollection(mrns); | |
pck.SaveAs(new FileInfo(@"C:\Temp\Output.xlsx")); | |
} |
NewerOlder