Skip to content

Instantly share code, notes, and snippets.

Avatar

George Dyrrahitis gdyrrahitis

  • Dublin, Ireland
View GitHub Profile
View EmbeddedImageHelper.cs
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Media.Imaging;
namespace LightSwitchApplication.Helpers
{
public class ImageHelper
{
@gdyrrahitis
gdyrrahitis / index.html
Created Aug 26, 2016
We have an image with white background and a black colored rectangle. 1 = white, 0 = black. Solution in finding any number of rectangles in a 2D array.
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Rectangles</title>
</head>
<body>
<h1>Find rectangles in images!</h1>
<button id="singleRectangle">Find single rectangle coordinates</button>
@gdyrrahitis
gdyrrahitis / prepare-commit.sh
Last active Jun 11, 2017
Git prepare commit hook to alter a file. Append commit id to the version.js file with a prepare-commit hook
View prepare-commit.sh
# Disclaimer: Commits should have the following format
# <PROJNAME>: <DESCRIPTION>
# Example:
# JIRA-450: My description
# Following code will substring the JIRA-450 and append it as last value of the `window.version` variable, replacing the `SAMPLE`
# This is just a sample, it is not recommended to do such mission, versions should be handled by CI and should follow the SEMVER specification: http://semver.org/
# Should add validation to ensure one is committing following the conventions
# Git hooks documentation https://git-scm.com/docs/githooks
@gdyrrahitis
gdyrrahitis / AbstractLinker
Created Aug 7, 2017
Drapper new features. Getting rid of the Drapper.Settings.json and introducing a simple container to register types and methods
View AbstractLinker
namespace Training.Misc
{
using System;
using System.Linq.Expressions;
using System.Reflection;
public abstract class AbstractLinker
{
protected MethodInfo GetMethodInfo<T>(Expression<Func<T, Delegate>> expression)
{
View csharp7_sample.cs
int.TryParse("5", out int value);
// Use value
@gdyrrahitis
gdyrrahitis / ubuntu-pod.yml
Created Jun 20, 2020
Long running ubuntu pod
View ubuntu-pod.yml
apiVersion: v1
kind: Pod
metadata:
name: ubuntu1
labels:
app: ubuntu1
spec:
containers:
- name: ubuntu1
image: ubuntu
View sftp-service.yml
apiVersion: v1
kind: Service
metadata:
name: sftp-service
spec:
selector:
app: sftp-server
ports:
- protocol: TCP
port: 22
View sftp-pod.yml
apiVersion: v1
kind: Pod
metadata:
name: sftp
labels:
app: sftp-server
spec:
containers:
- name: sftp-server-demo
image: atmoz/sftp