Skip to content

Instantly share code, notes, and snippets.

@amirkhan81
amirkhan81 / site-overlay.js
Created October 30, 2012 17:54
Append Site Overlay Div
$(function() {
var docHeight = $(document).height();
$("body").append("<div id='overlay'></div>");
$("#overlay")
.height(docHeight)
.css({
'opacity' : 0.4,
/*
* HTML5 Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
@amirkhan81
amirkhan81 / index.html
Last active December 21, 2015 01:08 — forked from anonymous/index.html
Touch Device Jelly Menu
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">-->
</head>
<body>
<div class="suggest-l"></div>
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var blogCategories = CurrentPage.AncestorOrSelf(1).blogCategories.Split(',');
}
@{
<nav id="mainNav">
<div class="wrapper">
<a id="main-menu-button">Menu</a>
<ul id="main-menu" class="sm sm-simple collapsed">
@amirkhan81
amirkhan81 / powershell-list-large-files.cs
Created November 30, 2015 16:18
Windows list large files
function Get-LowDisk($maxResults=15, $startLocation=(Get-Location)){
if("$startLocation".EndsWith("\")){$startLocation = "$startLocation".TrimEnd("\")}
function Calc-Directories ($startFolder, $foldersHT=@{}, $depth=1){ $itemSum = 0L;
if($startFolder -notmatch "c\:\\Windows|System Volume Information"){
$dirList = Get-ChildItem ($startFolder) -force
$folders = $dirList | Where-Object {$_.PSIsContainer -eq $True} | Where {($_.attributes.toString() -like "*ReparsePoint*") -eq $False};
$files = $dirList | Where-Object {!$_.PSIsContainer -eq $True}; if($files){$itemSum = ($files | Measure-Object -property length -sum).sum;}
if(!$folders.Count -and $folders -ne $null){
$subFolder = "$startFolder\" + $folders;
$itemSum += Calc-Directories "$subFolder" $foldersHT ($depth+1);
@foreach (var prop in Model.Content.Properties)
{
/* get each property value */
var value = prop.Value;
<h1>@value</h1>
}
@foreach (var prop in Model.Content.Properties)
{
/* get each property value */
var value = prop.Value;
var name = prop.PropertyTypeAlias;
<h1>@name and @value</h1>
}
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var root = Model.Content.AncestorOrSelf();
var top = root.Descendants("ProgramOrEventPage").OrderBy("startDateAndTime").GroupBy("startDateAndTime.Day");
}
@foreach (var groupDate in top) {
<h1>@groupDate.Key</h1>
}
@{
var dataTypeId = umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetAll().First(d=> d.Text == "Map - Icon").Id;
var dataTypeList = Umbraco.DataTypeService.GetPreValuesByDataTypeId(dataTypeId);
foreach(var dataTypeValue in dataTypeList) {
<p>@dataTypeValue</p>
}
}
dataLayer.on('click', function(e) {
allMarkers.eachLayer(function(marker) {
if(dataLayer.getBounds().contains(marker.getLatLng())){
console.log(marker.toGeoJSON().properties.Point_Name)
}
});
});