Skip to content

Instantly share code, notes, and snippets.

Kevin Giszewski kgiszewski

View GitHub Profile
View gist:990b71bb54f474b77d7162fea8cbb065
var overlaidImage = Image.FromFile(PATH_TO_WATERMARK);
using (var imageFactory = new ImageFactory(preserveExifData: true))
{
var factory = imageFactory.Load(IMAGE_STREAM_TO_ALTER);
using (var outStream = new MemoryStream())
{
factory.Overlay(new ImageLayer
{
View Lady Lovelace
61C8FFDE82025F318FB88E16EE88F97709AD2CEFC8B9DAAB24616FD1EE70EF75C507A95D715BDD87F7B2659BD25629C77615F70A7F84EAFE577E4E5E507CB3BC4191B7D26AC40DDA2357928272AF161C36CA17CBDB862BD318B50F28EE7AD33DA46313352B61953EC8B191CAF66D95D2545FC60CD1452CEE7E36FE5C2795BC804AED3AB3110810E135688D1EE7838A6F129A105B24CD4D9805CA37229CF0BBCDC3D873268EC3BF51214082DF1378CBAF8CEA44074268A5DB7B43332D1DAF9E9EFCBDA0308AFB30E01BF1E0919FA51F317D607033180278AE571205C81B684E489275AC0B04F9EE800EBEF0CC71EE5D1FFDC93462F7958BBF16D860D1B6055B7171FC7D2BB873D4F7C5D6E8583017EE7860D5316FB630878467339401D2DFDC563E7FFFE2F71348638F0E900CD69B274387B9727D9899B569734EE291269889F245CC6381003CE6C8195EBCF7902411A83267F051FEC8985FCAD3A7846CDF77DBA86BEA4E9F03915740BD654D580B00B060D63181183AED4860040C54070E4DA7D73112B3035C1233E3EFEC0AD7DD075BEA88BB197B49C884A0CDA3CDAB697F804EABA8E76F72C0B74CEC626E1739D855657943F8FFB14674715293B2FB8325EA9103577D9E9790D1126D63671CC876C9CCE79A175CA1DAE3A7B57F3EF09F56158452880186CFC96B71A89E7D32B635E931496B6FC0FA856740CBB0A7F6F0B74E
View gist:6535f033e754ed968b99c59e418e846e
public static class Mandate
{
public static void That<TException>(bool condition, string message) where TException : Exception
{
if (!condition)
{
var exceptionInstance = (TException)Activator.CreateInstance(typeof(TException), message);
throw exceptionInstance;
}
View gist:0bc64ad492aa6d07cf7e7b9b02aed297
public class EmbeddedResourceHelper
{
public string GetResource(string resourceLocation, Type type = null)
{
using (var stream = GetResourceStream(resourceLocation, type))
{
if (stream == null)
{
return string.Empty;
}
View gist:34e5ff159b51606fdab799cade369141
//add to service
public static IEnumerable<SomeModel> GetUser(string username)
{
using (var uow = new PetaPocoUnitOfWork())
{
return ContactAstudentRepository.GetUser(uow, username);
}
}
//add to repo
View Foo
@using Microsoft.AspNet.Identity
@inherits UmbracoTemplatePage
@{
var isAuthenticated = User.Identity.IsAuthenticated;
var username = User.Identity.GetUserName();
//run our access control check
View Vorto Extension
public static T GetVortoValueWithFallback<T>(this IPublishedContent content, string alias)
{
if (content == null)
{
LogHelper.Info<T>($"Vorto can't use null content with Alias => {alias}");
return default(T);
}
try
View gist:ac1e353eb2dc30974346c80a7b1d4a6a
using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace MendozaDM.Core.Helpers
{
public static class TransformationHelper
{
/// <summary>
View Video feedback
- Overall very good.
- Use an audio stinger for transition (e.g. during The Setup screen).
- Audio is good, slight bit of reverb (echo) on the mic.
- Static camera at times during explanations (while screensharing) -- perhaps call attention to something.
- "The Result", same as "The Setup", maybe a stinger and/or shorten the display time.
- I liked the "cut to you explaining things" with the effects.
- Can hear your keyboard clacking ;)
View package.manifest
var getDdlValue = function(selectedValue) {
return function(dataTypeResource) {
//it'd be nice to trade out the 1055 a dynamic value, but good nuff for now
return dataTypeResource.getPreValues("Umbraco.DropDown.Flexible", 1055).then(function (prevalues) {
var values = prevalues[1].value;
var actualValue = values[selectedValue[0]].value;
return actualValue;
You can’t perform that action at this time.