Skip to content

Instantly share code, notes, and snippets.

View greystate's full-sized avatar
:octocat:
Octocatering

Chriztian Steinmeier greystate

:octocat:
Octocatering
View GitHub Profile
@greystate
greystate / example.cshtml
Last active August 29, 2015 14:00
Razor/C# question
/* Some sample Razor code: */
@{
var myValues = "7,8";
foreach(var id in myValues.Split(',')) {
var myStringValue = umbraco.library.GetPreValueAsString(Convert.ToInt32(id));
<li>@myStringValue </li>
}
}
body {
-webkit-font-smoothing:antialiased;
font:normal .8764em/1.5em HelveticaNeue-Light,Helvetica,Arial,sans-serif;
margin:0;
}
html > body {
font-size:1em;
padding:1em;
}
@greystate
greystate / options-pattern.coffee
Created June 28, 2014 11:32
Pattern for an options hash
# The `spin()` function takes an options hash with `count` and `speed` options, e.g.:
#
# ```
# spin
# count: 4
# speed: 0.5
#
# ```
# (Slightly reworked from this slide: http://aseemk.com/talks/intro-to-coffeescript#/43)
#
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="xsl:template[@match]">
<xsl:text>@* Sorry, can't do that in Razor :( *@</xsl:text>
</xsl:template>
<xsl:template match="xsl:value-of[starts-with(@select, '$currentPage/')]">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
@greystate
greystate / dabblet.css
Created August 11, 2014 08:38
Two-color background - can be used for three, four, five etc.
/**
* Two-color background - can be used for three, four, five etc.
*/
background: #fff;
background: linear-gradient(90deg, #fff 50%, #f6f6f6 50%);
min-height: 100%;
@greystate
greystate / dabblet.css
Created August 22, 2014 13:16
Demo of using linear-gradient to create a grid-like background
/**
* Demo of using linear-gradient to create a grid-like background
*/
background: #cecece;
background: linear-gradient(90deg, #fff 1px, #cecece 1px);
background-size: 84px;
min-height: 100%;
@greystate
greystate / dabblet.css
Created August 22, 2014 13:47
Box layout
/**
* Box layout
*/
body { background: #cecece; }
section {
background: #fff;
padding: 10px;
width: 257px;
public class CompanyViewModel {
// use partial view "StreetAddress.cshtml"
public StreetAddress MainAddress {get; set;}
// use partial view "CompactAddress.cshtml"
[UIHint("CompactAddress")]
public StreetAddress StoreAddress {get; set;}
@greystate
greystate / dabblet.css
Last active August 29, 2015 14:06
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
ul {