Skip to content

Instantly share code, notes, and snippets.

View Kavignon's full-sized avatar
:octocat:

Kevin Avignon Kavignon

:octocat:
View GitHub Profile
@Kavignon
Kavignon / gist:967d41b1ab6b6f51aa62cc7e89b9773b
Created August 24, 2018 15:39
Sample content to try and load content of an attach property outside the UI thread
// Class to be inside the WPF class
public static class CustomClass
{
public static readonly DependencyProperty TextProperty = DependencyProperty.RegisterAttached(
"Text",
typeof(string),
typeof(CustomClass),
new UIPropertyMetadata(default(string)));
public static string GetText(DependencyObject obj)
@Kavignon
Kavignon / TodoListWithRedux
Created April 9, 2018 18:56
Built Todo list application with fundamental concepts in React & Redux
import createStore from "redux";
import combineReducers from "redux"
const todoItemCategoryAction = {
Add: "ADD_TODO",
Remove: "REMOVE_TODO",
Toggle: "TOGGLE_TODO",
ShowAll: "SHOW_ALL",
ShowCompleted: "SHOW_COMPLETED",
SetVisibilityFilter: "SET_VISIBILITY_FILTER"
using( var dbCtx = new DataContext())
{
var employeeTrainingResults = dbCtx.ExecuteQuery<EmployeeTrainingResult>(
@"@"with SomeTemporaryEmployeeTable(EmployeeID, SkillID, IsQualified)
as
(
select e.ID, jSkill.ID, case when jsQualifications.QualificationID is null then 0 else 1 end
from Employee e
join Job job on job.EmployeeID = e.ID
and job.ID = (select max(ID) from Job
@Kavignon
Kavignon / Employee query
Last active December 13, 2017 16:36
Query extracting whether or not an employee is suited (qualified) for a training
@"with SomeTemporaryEmployeeTable(EmployeeID, SkillID, IsQualified)
as
(
select e.ID, jSkill.ID, case when jsQualifications.QualificationID is null then 0 else 1 end
from Employee e
join Job job on job.EmployeeID = e.ID
and job.ID = (select max(ID) from Job
where EmployeeID = job.EmployeeID)
join JobGroup jobGroup on jobGroup.ID = job.JobGroupID
join JobSkill jSkill on jSkill.JobGroupID = job.JobGroupID
module ImageAnalyzer
open System
open System.Drawing
open Emgu.CV
open Emgu.CV.Structure
type HistComparisonCategory =
| PerfectMatch
| CloseMatch //between 75% and 100%
package main;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.*;
import java.sql.DriverManager;
import java.sql.SQLException;