This file contains 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
public static class IEnumerableExtensions | |
{ | |
public static IEnumerable<T> OrEmptyListIfNull<T>(this IEnumerable<T> source) | |
{ | |
return source ?? Enumerable.Empty<T>(); | |
} | |
} |
This file contains 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
private void CleanupXFormHtmlMarkup(XFormControl formControl) | |
{ | |
if (formControl.EditMode) | |
{ | |
// We need to render the default table when in edit mode, otherwise the form wizard won't work | |
return; | |
} | |
bool firstLiteralControl = false; |
This file contains 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
import requests | |
url = 'http://lazyeyedhacker.com/wp-comments-post.php' | |
headers = {'user-agent':'Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0', 'referrer':'http://lazyeyedhacker.com'} | |
for n in range(3,10000): | |
payload = {'author':'mua ha ha','email':'muahaha@lazyeyedhacker.com','url':'http://muahaha.lazyeyedhacker.com','comment':'blah','comment_post_ID':'1'} | |
payload['comment'] = 'muahaha ' * n | |
r = requests.post(url,data=payload,headers=headers) |
This file contains 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
private static bool PageDataHasChanged(PageData pageOne, PageData pageTwo) | |
{ | |
PageType type = PageType.Load(pageOne.PageTypeName); | |
foreach (var property in type.Definitions.Where(p=> GetPropertynames<CoursePage>().Contains(p.Name))) | |
{ | |
if (pageOne[property.Name] == pageTwo[property.Name]) | |
{ | |
continue; | |
} |
This file contains 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
[XmlIgnore] | |
public Uri Url { get; set; } | |
[XmlAttribute("uri")] | |
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] | |
public string UriString | |
{ | |
get { return Url == null ? null : Url.ToString(); } | |
set { Url = value == null ? null : new Uri(value); } | |
} |
This file contains 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
this.PageName = node.SelectSingleNode("T") != null ? EPiServer.Core.Html.TextIndexer.StripHtml(node.SelectSingleNode("T").InnerXml.Trim().HtmlDecode(),200) : string.Empty; | |
if (this.PageName.IsNullOrWhiteSpace()) | |
{ | |
this.PageName = "( No Title )"; | |
var UseWebRequestToResolveSupportTitle = | |
WebConfigurationManager.AppSettings["UseWebRequestToResolveSupportTitle"] != null && Convert.ToBoolean(WebConfigurationManager.AppSettings["UseWebRequestToResolveSupportTitle"]); | |
if (UseWebRequestToResolveSupportTitle) | |
{ | |
var cachedTitle = | |
(string)EPiServer.CacheManager.Get(SupportCacheKey); |
This file contains 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
require 'albacore' | |
$msbuildpath = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe' | |
$aspnet_compiler_path = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe' | |
$publishdir = 'Publish' | |
$major_version = '1' | |
task :default => [:full] | |
task :full => [:publish, :zip] do |
This file contains 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
# Load posh-git profile | |
. 'C:\Projects\Tools\posh-git\profile.example.ps1' | |
function vsh() { | |
Write-Output "Opening first solution..." | |
$sln = (dir -in *.sln -r | Select -first 1) | |
Write-Output "Found $($sln.FullName)" | |
Invoke-Item $sln.FullName | |
} |
This file contains 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
ALTER DATABASE [AspectoWeb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
RESTORE DATABASE [AspectoWeb] | |
FROM DISK = N'C:\Users\RasmusKL\Desktop\www.aspectoweb.com_backup_2011_12_15_030005_0285276\www.aspectoweb.com_backup_2011_12_14_031114_3950159.wbak' | |
WITH NORECOVERY, REPLACE | |
RESTORE DATABASE [AspectoWeb] | |
FROM DISK = N'C:\Users\RasmusKL\Desktop\www.aspectoweb.com_backup_2011_12_15_030005_0285276\www.aspectoweb.com_backup_2011_12_15_030005_0285276.bak' | |
WITH RECOVERY |
This file contains 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
param([string]$site=$(throw "Site argument is required.")) | |
function vdir-exists([string]$name) | |
{ | |
if((Test-Path -path $name) -eq $False) | |
{ | |
return $False | |
} | |
(Get-Item $name).GetType().Name -eq "ConfigurationElement" |
OlderNewer