Skip to content

Instantly share code, notes, and snippets.

@oucem
oucem / curl.md
Created March 22, 2022 10:49 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@oucem
oucem / FluxDataBufferParseExperiments.java
Created October 15, 2021 21:02 — forked from caprica/FluxDataBufferParseExperiments.java
Some experiments using Reactor to parse XML/JSON from a Flux of DataBuffer instances
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferUtils;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.io.BufferedWriter;
import java.io.FileWriter;
@oucem
oucem / example.kt
Created November 4, 2020 15:51 — forked from ajalt/example.kt
Kotlin initializer order example
open class Parent {
private val a = println("Parent.a")
constructor(arg: Unit=println("Parent primary constructor default argument")) {
println("Parent primary constructor")
}
init {
println("Parent.init")
}
@oucem
oucem / gist:94abc7eeefdada089182e08a15619218
Created March 30, 2020 17:58 — forked from freretuc/gist:3346696
Liste Gares SNCF France + codes gares
"frxab";"50.102";"1.82425";"Abbeville"
"frmlw";"49.0037";"2.57089";"Aéroport CDG 2 TGV"
"frxag";"43.3174";"3.46613";"Agde"
"fragf";"44.2084";"0.620312";"Agen"
"frais";"49.9284";"2.20058";"Ailly Sur Somme"
"frqai";"45.5543";"6.6489";"Aime la Plagne"
"frqxb";"43.5232";"5.44412";"Aix en Provence"
"fraie";"43.4553";"5.31723";"Aix en Provence TGV"
"frxai";"45.6879";"5.90924";"Aix les Bains le Revard"
"frale";"45.7861";"5.98222";"Albens"
@oucem
oucem / .gitconfig
Last active June 17, 2022 08:54 — forked from Mattgic/.gitconfig
git config
[user]
name = Rabhi Houcem
email = [email protected]
[core]
autocrlf = input
excludesfile = ~/.gitignore-global
editor = vim
[color]
ui = true
[alias]
@oucem
oucem / git-tips.txt
Created March 5, 2019 08:01 — forked from BabylonZeus/git-tips.txt
Git tips
A tout moment, pour savoir où on en est en local
git status
Récupérer un projet dans un nouveau dossier local et se positionner dans la branche develop
git clone ssh://[adresse_ip]:[port]/[path]
git checkout develop
git pull origin develop
En récurrent, pousser une modification locale vers le repository distant
git add ./chemin_vers_mon_fichier {ligne à passer pour chaque fichier à commiter}
@oucem
oucem / Application.java
Created July 17, 2018 08:31 — forked from serac/Application.java
Configuring RestTemplate for Client TLS in a Spring Boot Application
/*
* See LICENSE for licensing and NOTICE for copyright.
*/
package edu.vt.middleware.app;
import java.io.File;
import java.security.*;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
@oucem
oucem / loadExternalFiles.xml
Created April 21, 2018 17:25 — forked from jgcasta/loadExternalFiles.xml
Spring bean to describe how to load external property file, and Log4j.properties
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
@oucem
oucem / groovy-zip.groovy
Created February 14, 2018 17:38 — forked from welshstew/groovy-zip.groovy
groovy script to zip and unzip text/String content
// Simple groovy script to compress / decompress Strings
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
def zip(String s){
def targetStream = new ByteArrayOutputStream()
def zipStream = new GZIPOutputStream(targetStream)
zipStream.write(s.getBytes('UTF-8'))
zipStream.close()
def zippedBytes = targetStream.toByteArray()
@oucem
oucem / Unzipper.groovy
Created February 14, 2018 17:38 — forked from bdkosher/Unzipper.groovy
Groovy class for examining/extracting zip files.
import java.util.zip.*
/**
* Makes it easier to unzip files by adding extraction methods to the entries themselves and providing Closure-based methods for finding specific entries.
*
* For example, to extract all XML files to a certain directory:
* <code>
* new Unzipper(zip).findAllEntries { it.name.endsWith(".xml") }.each { it.extractTo(someDir) }
* </code>
*/