Skip to content

Instantly share code, notes, and snippets.

function isAnyPartOutsideViewPort($element) { //THIS SHOULD BE LIB FUNCTION
var element = $element[0];
var rect = element.getBoundingClientRect();
return rect.top <= 0 ||
rect.left <= 0 ||
rect.bottom >= $(window).height() ||
rect.right >= $(window).width();
}
public class DataMapperTests
{
[TestFixture]
public class WhenMap
{
internal class Source
{
public int id { get; set; }
}
public static class StopwatchUtil
{
public class StopwatchRecord
{
public DateTime StartTime { get; set; }
public string ActionName { get; set; }
public TimeSpan Elapsed { get; set; }
public override string ToString()
{
return string.Format("{0} - {1}: {2}", StartTime.ToShortDateString(), ActionName, Elapsed.ToString(@"hh'h'mm'm'ss's.'fffffff'ms'"));
$source = "C:\Scripts"
$archiveDestination = "C:\ScriptsArchive"
$type = "ps1"
$offsiteDrive = "M"
#Create mapping if missing
.\Map-Azure.ps1 -DriveLetter "$offsiteDrive" -StorageKey "[storage key]"
#Copy files to Archive
param (
[string] $dir
)
cd $dir
Get-ChildItem -File | Remove-Item
Get-ChildItem -Directory | ForEach-Object { C:\Scripts\Delete-Recursive "$(Get-Location)\$_" }
@christopherbauer
christopherbauer / A) Sysadmin Scripts
Last active October 19, 2018 21:29
Sysadmin Sql Scripts
This is a set of sysadmin scripts I've found useful in sql
@christopherbauer
christopherbauer / Mock HttpContext.Current.Request.cs
Last active January 16, 2017 21:58
How to Unit Test Web API
HttpContext.Current = new HttpContext(new HttpRequest(null, "http://someurl", null), new HttpResponse(new StringWriter()));
@christopherbauer
christopherbauer / HoverButton.css
Created January 25, 2017 21:35
Just interesting UX thoughts
div.workflow {
position: relative;
display: inline-block;
color: white;
cursor: pointer;
width: 96px;
height: 24px;
text-align: center;
overflow: hidden;
@christopherbauer
christopherbauer / Log.ps1
Created March 30, 2018 20:18
Basic Powershell Log
function log {
param([string] $message, [bool] $isOutput = $true)
$logDate = (get-date).ToUniversalTime()
$logFormatted = $logDate.ToString("yyyy-MM-dd HHmmss zzz")
if($isOutput) {
write-output "$($logFormatted): $message"
}
else {
write-host "$($logFormatted): $message"
//eyy
//https://jsfiddle.net/r479tc2n/101/