Skip to content

Instantly share code, notes, and snippets.

View LinuxDoku's full-sized avatar

Martin Lantzsch LinuxDoku

View GitHub Profile
@LinuxDoku
LinuxDoku / NullCheckMatcher.cs
Created December 17, 2015 23:58
Null check the model when working with nancy's super simple view engine.
using System.Text.RegularExpressions;
using Nancy.ViewEngines.SuperSimpleViewEngine;
namespace Residata.Analysis.Web.Infrastructure {
/// <summary>
/// Null Check Matcher for the super simple view engine.
///
/// This checks if the model is null - or not!
/// </summary>
/// <example>
@LinuxDoku
LinuxDoku / AppDomainHelper.cs
Created December 29, 2014 21:02
Best guy when working with .NET remoting
using System;
namespace Residata.Platform.Server.Helper {
public static class AppDomainHelper {
public static T CreateInstanceAndUnwrap<T>(this AppDomain appDomain) {
return (T)appDomain.CreateInstanceAndUnwrap(typeof (T).Assembly.FullName, typeof (T).FullName);
}
}
}
@LinuxDoku
LinuxDoku / gist:b343469c7128e634f83d
Created October 11, 2014 20:48
Virtual Box Windows Partition extending
VBoxManage modifyhd "Windows 8.1 Dev.vdi" --resize 30720
Manage Computer -> Disk Manager -> 25GB HD -> extend Volume -> select 5GB -> Finish
<?php
namespace TheInsider\WebServiceBundle\Entity;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
use TheInsider\Domain\Entity\Article as DomainArticle;
/**
* Doctrine implementation of the article domain entity.
*
* @author Martin Lantzsch <martin.lantzsch@residata.de>
@LinuxDoku
LinuxDoku / gist:87bfcc58694fb33e179f
Created May 4, 2014 12:04
MessageTask for Xamarin Bug Report
using System;
using TaskProcessor.Contracts;
namespace TaskProcessor.Tasks
{
/// <summary>
/// A simple task which prints a message to stdout.
/// </summary>
public class MessageTask : ITask
{
@LinuxDoku
LinuxDoku / gist:6500963
Created September 9, 2013 20:22
mysql encryption
CREATE TABLE `data` (
`name` varchar(255) DEFAULT NULL,
`value` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into crypt_test.data values("hello.world", AES_ENCRYPT("test", SHA2("ld", 512)));
select CONVERT(AES_DECRYPT(value, SHA2("ld", 512)) using UTF8) as d FROM crypt_test.data
@LinuxDoku
LinuxDoku / gist:6249742
Created August 16, 2013 12:57
markup filter regex for variable assignment inside if()
if[ \n]*\([0]*[^ ]*\$[a-z0-9-_]+[ ]*=[^=]+[ ]*[^ ]+[ ]*\)
#include <stdio.h>
int fak(int n);
void main() {
printf("%d\n", fak(3));
}
int fak(int n) {
if(n == 1) {
#include <stdio.h>
void main() {
int i, z;
int arr[5] = {6, 7, 1, 3, 2};
for(i = 5; i >= 0; i--) {
for(z = 0; z < i - 1; z++) {
if(arr[z] > arr[z + 1]) {
int tmp = arr[z];
Array
(
[0] => teamspeak2
[1] => help
[2] => ver
[3] => banadd
[4] => banclear
[5] => bandel
[6] => banlist
[7] => banplayer