This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestMethod] | |
| public void Description_Should_Be_Required() | |
| { | |
| Expression<Func<MenuCategoryBusinessObject, object>> expression = | |
| o => o.Description; | |
| var me = expression.Body as MemberExpression; | |
| var att = (RequiredAttribute[])me.Member | |
| .GetCustomAttributes(typeof(RequiredAttribute), false); | |
| att.Length.ShouldEqual(1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace demo_002.Models | |
| { | |
| public class ByteInfoAttribute : ValidationAttribute | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rvm homepage :http://beginrescueend.com/ | |
| # rubyonrails homepage :http://rubyonrails.org/ | |
| # using gemset : http://beginrescueend.com/gemsets/using/ | |
| # js env : https://github.com/sstephenson/execjs | |
| # heroku hosting : http://www.heroku.com/ | |
| # github repo : https://git.521000.bestlow | |
| # gmate for gedit : https://github.com/gmate/gmate | |
| # ruby dependencies | |
| sudo apt-get install build-essential openssl libssl-dev libreadline6 libreadline6-dev curl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> | |
| <#@ Output extension="txt" #> | |
| <#@ assembly name="System.ComponentModel.DataAnnotations" #> | |
| <#@ assembly name="System.Core" #> | |
| <#@ assembly name="System.Data.Entity" #> | |
| <#@ assembly name="System.Data.Linq" #> | |
| <#@ import namespace="System" #> | |
| <#@ import namespace="System.Collections" #> | |
| <#@ import namespace="System.Collections.Generic" #> | |
| <#@ import namespace="System.ComponentModel.DataAnnotations" #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("tr:nth-child(odd)").addClass("odd"); | |
| $("tr:nth-child(odd)").hover(function(){ | |
| $(this).addClass("odd_over"); | |
| },function(){ | |
| $(this).addClass("odd_out"); | |
| }); | |
| $("tr:nth-child(even)").hover(function(){ | |
| $(this).addClass("even_over"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pattern = @"^Sl[A-Z]{1}"; | |
| var stringSearch = "SlKanton"; | |
| var demo = Regex.Match(stringSearch, pattern); | |
| Console.WriteLine("Wurde der Wert gefunden ? : {0} der wert is : {1}",demo.Length ,demo.Value); | |
| if (demo.Success) | |
| { | |
| Console.WriteLine(stringSearch.Remove(demo.Index, demo.Length - 1)); | |
| } | |
| Console.ReadLine(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* link to the source: http://webdesign.about.com/od/css3/qt/alternating-row-styles-tables.htm */ | |
| /* http://www.w3schools.com/css/css_pseudo_classes.asp */ | |
| /*table http://webdesign.about.com/od/tables/ss/aa120897.htm */ | |
| /* Select the last 4 element from a list */ | |
| li:nth-last-child(-n+4) { background-color: #ccc; } | |
| /* zebra */ | |
| li:nth-child(odd){background-color: #eee;} | |
| li:nth-child(even){background-color: #ddd;} | |
| /* zebra rows in table */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace demo_03.Controllers | |
| { | |
| public class JsonController : Controller | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # read info from the current host | |
| # replace "." with your remote host - if you like | |
| $OS = get-wmiobject win32_operatingsystem -ComputerName . | |
| # default values | |
| $OSSP = "{n.a}" | |
| $OSName = "{n.a}" | |
| $OSLastBoot = "{n.a}" | |
| $OSUpTime = "{n.a}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Convert vmdk image to vdi image | |
| + example kdenlive demo image | |
| VBoxManage clonehd --format vdi kdenlive-x64-20090612.vmdk kdenlive.vdi | |
| 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | |
| Clone hard disk created in | |
| format 'vdi'. UUID: 16b93434-ad55-465d-ad2a-77dab75c9223 | |
| # htop iotop atop pciutils | |
| # vmware tools and setup |