Skip to content

Instantly share code, notes, and snippets.

View DavidVotrubec's full-sized avatar

David Votrubec DavidVotrubec

View GitHub Profile
@DavidVotrubec
DavidVotrubec / Less - Transition Mixin
Created May 20, 2014 07:25
Mixin for css transition
.transition(@property, @duration: 1s){
-webkit-transition: @property @duration;
-moz-transition: @property @duration;
-ms-transition: @property @duration;
-o-transition: @property @duration;
transition: @property @duration;
}
@DavidVotrubec
DavidVotrubec / sg-readonly
Last active August 29, 2015 13:56
sg-readonly directive (written in TypeScript). Disables all nested fields when condition is met.
Module.directive("sgReadonly", [() => {
function toggleDisableAttr(fields:any[], isDisabled:boolean) {
_.each(fields, (f: any) => angular.element(f).prop('disabled', isDisabled));
}
return {
restrict: "A",
scope: {
isReadonly: '=sgReadonly',
@DavidVotrubec
DavidVotrubec / HtmlTextWriter_GetText_Demo
Created October 19, 2011 09:36
Get text value from HtmlTextWriter
var sb = new StringBuilder();
var sw = new StringWriter(sb);
using(var writer = new HtmlTextWriter(sw))
{
writer.AddAttribute(HtmlTextWriterAttribute.Href, someUrl);
writer.AddAttributeValues(HtmlTextWriterAttribute.Class, "actionCell", "download");
writer.AddAttributeIf(Target != null, HtmlTextWriterAttribute.Target, Target);
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.WriteEncodedText("Download");