Skip to content

Instantly share code, notes, and snippets.

View dsebastien's full-sized avatar

Sebastien Dubois dsebastien

View GitHub Profile
@dsebastien
dsebastien / create
Created February 27, 2014 22:10
git-shell-commands - create
#!/bin/sh
# Adapted from: http://planzero.org/blog/2012/10/24/hosting_an_admin-friendly_git_server_with_git-shell
# comment out or adapt if you want to allow non-root users to create new repositories
# If the user is not root
if [ "$USERNAME" != "root" ]
then
# Display a notice and stop
echo "Sorry, only root can use this command."
@dsebastien
dsebastien / .profile
Created July 30, 2015 15:38
Bash profile
# this file should be loaded using "source" in the Bash Profile (~/.profile)
# source /c/CloudStation/Configuration/Bash/bashProfile.txt
# =================================================================================================
# Bash config
# =================================================================================================
clear # clear the MSYS MOTD
HISTSIZE=3000 # Big history
SAVEHIST=3000 # Big history
@dsebastien
dsebastien / ConEmu.xml
Created August 7, 2015 12:46
ConEmu configuration
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2015-08-07 14:40:47" build="150728">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Bash::Git bash}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
@dsebastien
dsebastien / .cpp
Created August 8, 2015 00:38
CPP Move foreground window to monitor where the mouse is located
// WindowsFun.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include "utils.h"
using namespace std;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!-- Sat, 1 Jan 200 Generated from KCHR: "Belgian" -->
<!--Created by Ukelele version 1.6.1 on 2005-08-20 at 00:31 (CEST)-->
<!--Last edited by Ukelele version 1.6.4 on 2005-11-11 at 08:56 (CET)-->
<keyboard group="0" id="5" name="Belgian (Non-Apple)" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="commonModifiers" mapSet="ANSI"/>
</layouts>
<modifierMap id="commonModifiers" defaultIndex="0">
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package be.itsee.ecool.events.schemas.schools;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
@dsebastien
dsebastien / gist:ab3f2828a84289ad1b7cf29d674c4faf
Created December 26, 2017 18:13
Convert object to GenericRecord
override fun convertToGenericRecord(thing: Any, schema: Schema): GenericRecord {
logger.trace { "Building a generic Avro record for the object" }
val genericRecordBuilder = GenericRecordBuilder(schema)
logger.trace { "Adding entries to the generic record for each property of the object" }
// TODO write utility with cache to find match between member properties and schema Field objects
// to accelerate later. See
thing::class.memberProperties
// we only care about public properties
override fun getFieldName(property: KProperty1<*, *>): String {
logger.debug { "Searching for the actual Avro field name for the following property: [${property.name}]" }
var retVal: String = property.name
logger.trace { "Retrieving the Java field" }
val field: Field? = property.javaField
val avroName: AvroName?
if (field == null) {
avroName = null
POST http://localhost:8080/schools?name=Herchies&description=Ecole communale
2018-01-01 03:09:20.812 INFO 10624 --- [nio-8080-exec-1] b.i.ecool.controllers.SchoolController : Handling a request to create a school
2018-01-01 03:09:20.892 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Request to create a new school: CreateSchoolCommand(name=Herchies, description=Ecole communale)
2018-01-01 03:09:20.893 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Verifying that no other school already exists with that name
2018-01-01 03:09:20.962 INFO 10624 --- [nio-8080-exec-1] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Hibernate:
/* select
generatedAlias0.id
# tHe nEtWoKed BrAiN hAcKeRs cOrp.
# klh@mygale.org
presents...
/\
/ /
__ <| > >> <<
\ \ /\ || / / _/\_ /|
\ \ / \_____|| . . _/ \_ / |
\ \/ \__@__/ \___/ \___/ /____________