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
function portfolioEditorDialogdialogRequestedHandler() { | |
$(document).bind('keydown', function (event) { | |
if (event.which == 8) { | |
var target = $(event.target); | |
if (!target.is('input')) | |
event.preventDefault(); | |
} | |
}); | |
} |
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
Get-ChildItem $myGitRepoPath | foreach { $rootDir = $_.FullName; $gitPath = join-path $_.FullName ".git"; $driveName = $_.BaseName.Replace('.','_'); if(test-path $gitPath){ New-PSDrive -name $driveName -psprovider FileSystem -root $rootDir } } |
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
#!/bin/bash | |
LAYOUTROOT=/put/a/directory/here | |
layoutName=$1 | |
projectName=$2 | |
[ -n "$layoutName" -a -n "${projectName}" -a -d "${LAYOUTROOT}/${layoutName}" ] && ( | |
layout="${LAYOUTROOT}/${layoutName}" | |
echo "Templating from ${layout}" |
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 EntityExtensions | |
{ | |
public static void MergeChanges<TEntity>(this TEntity targetEntity, TEntity sourceEntity) where TEntity: IPersistable | |
{ | |
var publicWritableProps = typeof(TEntity).GetProperties(BindingFlags.Instance | BindingFlags.Public); | |
foreach (var prop in publicWritableProps) | |
{ | |
if (prop.Name != "PersistenceKey") | |
{ | |
var newValue = prop.GetValue(sourceEntity, null); |
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 EntityLinqExtensions | |
{ | |
public static bool None<TEntity>(this IEnumerable<TEntity> items, Func<TEntity, bool> predicate) | |
{ | |
return !items.Any(predicate); | |
} | |
} |
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
(define (script-fu-xcf2jpg-batch xcfDirectory inQuality) | |
(let* ((xcfList (cadr (file-glob (string-append xcfDirectory "/*.xcf") 1)))) | |
(while (not (null? xcfList) ) | |
(let* ((xcfFilename (car xcfList)) | |
(jpgFilename (string-append (substring xcfFilename 0 (- (string-length xcfFilename) 4) ) ".jpg")) | |
(xcfImage (car (gimp-file-load RUN-NONINTERACTIVE xcfFilename xcfFilename))) | |
(xcfDrawable (car (gimp-image-flatten xcfImage))) ) | |
(file-jpeg-save RUN-NONINTERACTIVE xcfImage xcfDrawable jpgFilename jpgFilename | |
inQuality 0.0 0 0 "" 0 1 0 2) | |
) |
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
using System.Linq; | |
using System.Web.Mvc; | |
public static class ModelStateDictionaryExtensions | |
{ | |
#if DEBUG | |
public static void DumpErrors(this ModelStateDictionary modelState) | |
{ | |
var errors = modelState.Where(a => a.Value.Errors.Count > 0) |
OlderNewer