Skip to content

Instantly share code, notes, and snippets.

@dkarzon
dkarzon / ImgToXlsx.cs
Last active November 10, 2021 09:29
Console app that reads an image file and creates an excel file with each pixel colour info in the text and cell background (1 Pixel = 1 cell wide x 2 cells high)
using System;
using System.Collections.Generic;
using System.Drawing; // Nuget System.Drawing.Common
using System.Linq;
using IronXL; // Nuget IronXL.Excel
namespace ImgToXlsx
{
class Program
{
@dkarzon
dkarzon / FixedImageRenderer.cs
Created July 20, 2017 12:03
A Xamarin.Forms ImageRenderer for UWP to read images from an Images folder.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DkDevelopment.UWP;
using Xamarin.Forms;
using Xamarin.Forms.Platform.UWP;
using Xamarin.Forms.Internals;
@dkarzon
dkarzon / ResizeForWindowsStore.ps1
Last active December 8, 2016 00:24
Powershell script to resize icons for the Windows 8.1 Store and Windows Phone 8.1 Store
# https://gallery.technet.microsoft.com/scriptcenter/Resize-Image-A-PowerShell-3d26ef68
function Resize-Image
{
<#
.SYNOPSIS
Resize-Image resizes an image file
.DESCRIPTION
This function uses the native .NET API to resize an image file, and optionally save it to a file or display it on the screen. You can specify a scale or a new resolution for the new image.
@dkarzon
dkarzon / AdaptiveStateTriggers.xaml
Created May 1, 2015 14:41
Windows 10 state triggers and property setters
<VisualStateManager.VisualStateGroups>
<VisualStateGroup >
<VisualState x:Name="MaxWidth768">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="status.Text" Value="Less than 768px" />
</VisualState.Setters>
</VisualState>
@dkarzon
dkarzon / gh-pages.min.css
Created April 21, 2015 22:26
Github pages combine/minify css
{% capture sitecss %}
{% include_relative bootstrap.custom.css %}
{% include_relative external.css %}
{% include_relative fonts.css %}
{% include_relative pygments.css %}
{% include_relative style.css %}
{% endcapture %}
{{ sitecss | strip_newlines }}
@dkarzon
dkarzon / android.js
Created January 21, 2015 09:05
NumberTap platform code
window.NUMBERTAP_PLATFORM = 3; //Android
(function () {
// Append the bind() polyfill
var scriptElem = document.createElement('script');
scriptElem.setAttribute('src', 'js/android2.3-jscompat.js');
if (document.body) {
document.body.appendChild(scriptElem);
} else {
document.head.appendChild(scriptElem);
@dkarzon
dkarzon / quotes.csx
Created September 24, 2014 22:40
mmbot formated quotes bro
var robot = Require<Robot>();
robot.Respond("((quote)( me)? (.*) by (.*)?)|((quote)( me)? (.*))", msg =>
{
var quote = string.IsNullOrWhiteSpace(msg.Match[4]) ? msg.Match[9] : msg.Match[4];
var byLine = "pikachu";
if (!string.IsNullOrWhiteSpace(msg.Match[5]))
{
byLine = msg.Match[5];
@dkarzon
dkarzon / scrollable.js
Last active August 29, 2015 14:06
Horizontal scrollable angular directive
angular.module('dk.directives')
.directive('dkscrollable', function () {
//<div dkscrollable>
//Handles the scrolling table for the site
function handleWheel(event) {
event.currentTarget.scrollLeft += event.wheelDelta * -1;
event.preventDefault();
};
@dkarzon
dkarzon / CommitOfTheDay.csx
Last active August 29, 2015 14:06
mmbot script for tracking #CommitOfTheDay
var robot = Require<Robot>();
robot.Respond("last (.*) commits", msg =>
{
var commitNum = 3;
try
{
commitNum = Int32.Parse(msg.Match[1]);
}
catch (Exception) { }
@dkarzon
dkarzon / atom.xml
Created January 9, 2014 03:25
Jekyll rss feed from dkdevelopment.net
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>DK Development</title>
<link href="http://dkdevelopment.net/atom.xml" rel="self"/>
<link href="http://dkdevelopment.net/"/>