Skip to content

Instantly share code, notes, and snippets.

View claushingebjerg's full-sized avatar

Claus Hingebjerg claushingebjerg

View GitHub Profile
@claushingebjerg
claushingebjerg / gist:f14faa3514778c2b35715189e13bdcd9
Created July 4, 2017 17:34
3d canvac perspective transform
.video-wrapper {
perspective: 1000px;
}
video {
transform: rotateY(-30deg);
}
<div class="video-wrapper">
<video width="400" controls>
<source src="http://www.w3schools.com/HTML/mov_bbb.mp4" type="video/mp4">
<source src="http://www.w3schools.com/HTML/mov_bbb.ogg" type="video/ogg">
@Html.Raw(@umbraco.library.ReplaceLineBreaks(@Model.property));
@claushingebjerg
claushingebjerg / Equal height
Created June 30, 2015 10:58
Set all elements to equal height of heighest, Javascript Jquery
var maxHeight = 0;
$(".myElement").each(function(){
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});
$(".myElement").height(maxHeight);
@claushingebjerg
claushingebjerg / Nupickers xml picker xpath
Last active December 13, 2016 18:38
Nupickers xml picker xpath
Get all nodes of doctype below level 2
$ancestorOrSelf/ancestor-or-self::* [@level=2]//*[@isDoc][self::Kategori]
Get all nodes of doctype
//*[@isDoc][self::Kategori]
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@claushingebjerg
claushingebjerg / Render custom LeBlender link to node datatype in grid, partial
Last active December 13, 2016 18:37
Render custom LeBlender link to node datatype in grid, partial
@claushingebjerg
claushingebjerg / Render slimsy responsive image, partial
Last active August 29, 2015 14:23
Render slimsy responsive image, partial
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div>
@if (CurrentPage.HasValue("imageID"))
{
var featureImage = Umbraco.Media(CurrentPage.imageID);
<img style="max-width:100%;" src="@featureImage.GetResponsiveImageUrl(1400, 490)" alt="" />
}
</div>
@claushingebjerg
claushingebjerg / Render the grid in umbraco 7.2
Created June 24, 2015 11:24
Render the grid in umbraco 7.2+
If your grid property is aliased bodyText you can do:
@CurrentPage.GetGridHtml()
Else you have to give it the property alias that you gave it:
@CurrentPage.GetGridHtml("myGridPropertyAlias")
By default it will render Bootstrap3 compatible markup. You can overload it:
@CurrentPage.GetGridHtml("myGridPropertyAlias", "bootstrap2")
Will render bootstrap2 compatible markup.
@claushingebjerg
claushingebjerg / List pages by tag
Last active August 29, 2015 14:23
List all nodes with a tag from querystring, partial view
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
string tagToFind = Request.QueryString["tag"];
var allNodesWithTags = Umbraco.TagQuery.GetContentByTag(tagToFind);
}
@foreach (var node in allNodesWithTags)
{
<a href="@node.Url">@node.Name</a><br />