Skip to content

Instantly share code, notes, and snippets.

@iwannabebot
iwannabebot / ThumbnailFunction.cs
Created October 8, 2019 13:35
GcImaging ThumbnailFunction
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace GrapeCity.Documents.Imaging.FunctionsV2
{
public static class ThumbnailFunction
{
[FunctionName("ThumbnailFunction")]
public static void Run(
@iwannabebot
iwannabebot / xrm-meta-models.ts
Last active February 8, 2019 13:56
XRM Metadata SDK in TypeScript
export interface XrmMetaAttribute {
LogicalName: string;
MetadataId: string;
DisplayName: DisplayName;
Description: Description;
IsCustomizable: IsCustomizable;
IsAuditEnabled: IsAuditEnabled;
OptionsSet: any;
AttributeType: string;
HasChanged?: any;
@iwannabebot
iwannabebot / AWSLambdaFunction.cs
Created December 24, 2018 06:58
AWS Lambda Template Function
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Amazon.Lambda.Core;
using Amazon.Lambda.S3Events;
using Amazon.S3;
using Amazon.S3.Util;
@iwannabebot
iwannabebot / MimeService.cs
Last active December 24, 2018 05:29
A C# utility class that gives your the Mime type from the file extension.
using System;
using System.Collections.Generic;
using System.Web;
namespace Iwannabebot.Utility.Web
{
public class MimeService
{
public static string Get(string extension)
{
@iwannabebot
iwannabebot / GCImagingAWSLambdaS3.cs
Last active December 26, 2018 06:05
GCImagingAWSLambdaS3
public async Task<string> FunctionHandler(S3Event evnt, ILambdaContext context)
{
var s3Event = evnt.Records?[0].S3;
if(s3Event == null)
{
return null;
}
try
{
@iwannabebot
iwannabebot / GcImagingOperations.cs
Last active April 23, 2021 03:27
GcImagingOperations
using System;
using System.IO;
using System.Drawing;
using GrapeCity.Documents.Drawing;
using GrapeCity.Documents.Text;
using GrapeCity.Documents.Imaging;
namespace GCImagingAWSLambdaS3
{
public class GcImagingOperations
{
@iwannabebot
iwannabebot / UIHelper.cs
Created October 17, 2018 09:07
Search a WPF control hierarchy for controls that match a given name or type
/// <summary>
/// Finds a Child of a given item in the visual tree.
/// </summary>
/// <param name="parent">A direct parent of the queried item.</param>
/// <typeparam name="T">The type of the queried item.</typeparam>
/// <param name="childName">x:Name or Name of child. </param>
/// <returns>The first parent item that matches the submitted type parameter.
/// If not matching item can be found,
/// a null parent is being returned.</returns>
/// Usage:
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created September 10, 2018 13:35
You can optionally include Material Icons in your application:
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created September 10, 2018 13:34
Use our theme builder to decide some colour combinations. After deciding some arbitrary colour combination, you would be provided with a code to include in your layout page.
<link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.deep_purple-pink.min.css">
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/themes/material/wijmo.theme.material.deep_purple-pink.min.css" />
@iwannabebot
iwannabebot / UpdateLayout.cshtml
Created September 10, 2018 13:33
Include the Material Lite JavaScript file in _Layout page of your application.
<script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>