Skip to content

Instantly share code, notes, and snippets.

View NKame's full-sized avatar
🌴
Moi je fais du skinôtic

NKame

🌴
Moi je fais du skinôtic
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:tns="http://graphml.graphdrawing.org/xmlns">
<xsl:template match="tns:edge">
<xsl:element name="edge" namespace="http://graphml.graphdrawing.org/xmlns">
<xsl:attribute name="id"><xsl:value-of
select="tns:data[@key='edgeid']/text()" /></xsl:attribute>
<xsl:apply-templates select="@*" />
<xsl:apply-templates />
@NKame
NKame / gist:204cbcb4119b67f45525
Last active October 10, 2016 08:10
Modification de la XSLT de génération d'un fichier GraphML à partir d'un fichier de dépendances issu de DependencyFinder, afin de pouvoir charger le fichier dans Tinkerpop
<?xml version="1.0"?>
<!--
Copyright (c) 2001-2009, Jean Tessier
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@NKame
NKame / gist:293f6ace390328916b94
Last active August 29, 2015 14:04
Code rajouté dans TOUS les fichiers .groovy pour éviter l'erreur interne Groovy quand crsh-cli 1.2 est dans le classpath, même ceux qui ne sont pas liés à CRaSH. Bug dans GRECLIPSE, c'est certain, mais il y a un autre élément dans le mix.
import org.crsh.cli.Argument
import org.crsh.cli.Command
import org.crsh.cli.Man
import org.crsh.cli.Option
import org.crsh.cli.Required
import org.crsh.cli.Usage
import org.crsh.command.CRaSHCommand
import org.crsh.command.InvocationContext
import org.crsh.command.PipeCommand
import org.crsh.command.ScriptException
@NKame
NKame / gist:6045729
Created July 20, 2013 17:08
Récupère des bouts de document Word 2007 borké par MacOS.
<?php
header('Content-Type: text/xml; charset=ISO-8859-1');
$text = file_get_contents('document.xml');
$offset = 0;
while ($offset >= 0) {
$ord = ordutf8($text, $offset);
if($ord > 128) {
if($ord == 8217) {
echo "'";
} else if ($ord == 333) {
@NKame
NKame / thoughts.mdown
Created October 9, 2012 21:57 — forked from davidbgk/thoughts.mdown
About interacting with David Thoughts

A small note in David Larlet's thoughts says he is frustrated about not having interactions in his thoughts. Christian Fauré made a comment on twitter about:

  1. Writing in French instead of English.
  2. Having the possibility for comments.

I started to write a tweet for answering to Christian and David and thought, Twitter is not the right place. But I still have a stream of thoughts that I could share. Usenet was quite practical for this in the past. Very handy for sharing thoughts and discussing at the same time without any approval… until the first spam on Usenet, but I digress or more exactly it is too early for this argument.

David: There will always be spam where there is attention (and value).

→ Damien : premier échec, on ne sait même pas qui a écrit le premier paragraphe, c'est un peu gênant quand cette personne vient ressasser Usenet ; est-ce que j'évo

@NKame
NKame / reconstruit_requete_hibernate.php
Created October 9, 2012 21:55
Simple interpolation des paramètres dans une requête SQL, requête paramétrée et paramètres étant récupérés dans les traces Hibernate (org.hibernate.SQL et org.hibernate.type). Ne gère pas grand chose...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/hml;charset=UTF-8">
<title>Reconstitution requête Hibernate</title>
</head>
<body>
<form method="POST" action="?">
<textarea name="content" cols="130" rows="50">
<?=isset($_POST['content'])?$_POST['content']:''?>