Skip to content

Instantly share code, notes, and snippets.

View esskar's full-sized avatar
🙋‍♂️
Hello!

Sascha Kiefer esskar

🙋‍♂️
Hello!
View GitHub Profile
@esskar
esskar / Foo.cpp
Created September 24, 2012 23:22
passing char*[] from c++ dll Struct to c#
#include <stdio.h>
#include <Windows.h>
struct Name
{
char FirstName[100];
char LastName[100];
char *Array[3];
};
@esskar
esskar / CustomDynamicObject.cs
Last active January 29, 2016 16:13
Objects to XML and back to Dynamics
internal class CustomDynamicObject : DynamicObject
{
private readonly IDictionary<string, object> _values;
public CustomDynamicObject()
{
_values = new Dictionary<string, object>();
}
public virtual bool HasDynamicMember(string name)
@esskar
esskar / CmsDumper.cs
Last active August 29, 2015 14:03
CMS Enveloped Data Dumper.
using System;
using System.IO;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.Xml;
namespace CmsDumper
{
class Program
{
static void Main(string[] args)
@esskar
esskar / CustomMiddleWare.cs
Last active August 29, 2015 14:03
SignalR and MiddleWare
public class CustomMiddleWare : OwinMiddleware
{
public CustomMiddleWare(OwinMiddleware next)
: base(next) { }
public override Task Invoke(IOwinContext context)
{
try
{
if (context.Request.QueryString.HasValue)
@esskar
esskar / MultiSelectItemAnimator.java
Created August 16, 2018 15:52 — forked from darnmason/MultiSelectItemAnimator.java
ItemAnimator for RecyclerView that animates changes between 2 states, edit and standard which is useful for multi select using check boxes. In edit mode a checkBox slides in from the left and an icon slides off screen to the right. In between an avatar and name view must adjust their positions. All 4 views are in a horizontal LinearLayout with w…
public class MultiSelectItemAnimator extends DefaultItemAnimator {
private static final long DURATION = 150;
private final ArrayMap<RecyclerView.ViewHolder, AnimatorInfo> animatorMap = new ArrayMap<>();
private final Animator.AnimatorListener resetListener = new ViewObjectAnimatorListener() {
@Override
public void onAnimationEnd(Animator animation, View view) {
view.setTranslationX(0f);
}
@esskar
esskar / fakeserver.py
Created September 7, 2018 14:46 — forked from dlenski/fakeserver.py
Fake server for RSA SecurID token generation
#!/usr/bin/env python3
# Needs: Python 3.5+, Flask, PyCryptoDome
# server.pem, rsapubkey.pem + rsaprivkey.pem (1024-bit) in the current directory
#
# What it does:
# Pretends to be the "CT-KIP" web service (https://tools.ietf.org/html/rfc3948) that
# RSA SecurID Token for Windows v5.0.x talks to to set up a new token, using an
# authentication code.
#