Skip to content

Instantly share code, notes, and snippets.

LiBe libetl

Block or report user

Report or block libetl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Router.kt
package org.toilelibre.libe
import kotlin.math.pow
import kotlin.reflect.full.companionObject
import kotlin.reflect.full.companionObjectInstance
import kotlin.reflect.full.declaredFunctions
import kotlin.reflect.full.memberProperties
class Router constructor(tableInput: String) {
libetl / XmlToMap.kt
Last active Jun 25, 2019
View XmlToMap.kt
package xmltomap
object XmlToMap {
private val CDATA = Regex("^<!\\[CDATA\\[(.+?)\\]\\]>")
private val OPENING_TAG = Regex("^<([^\\s>/]+)[^>]*>")
private val OPENING_CLOSING_TAG = Regex("^<([^\\s>/]+)[^>]*/>")
private val CLOSING_TAG = Regex("^</([^\\s>]+)>")
private val ATTRS = Regex("([a-zA-Z][a-zA-Z-0-9]*)=\"([^\"]*)\"")
private val UPPERCASE = Regex("[A-Z]+")
libetl / RestTemplateInjector.kt
Last active Oct 31, 2018
View RestTemplateInjector.kt
package com.myservice.infra.testinterceptor
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.http.HttpRequest
import org.springframework.http.HttpStatus
import org.springframework.http.client.ClientHttpRequestExecution
import org.springframework.http.client.ClientHttpRequestInterceptor
import org.springframework.http.client.ClientHttpResponse
import org.springframework.mock.http.client.MockClientHttpResponse
libetl / KotlinBuilderTest.kt
Created Oct 17, 2018
simplest kotlin builder
View KotlinBuilderTest.kt
fun main(args: Array<String>) {
val choosenMenu = menu {
View package.json
"name": "yamlchecker",
"version": "0.0.1",
"private": true,
"dependencies": {
"yamljs": "latest"
"devDependencies": {
"webpack": "latest"
View readGtfsDumps.js
const {get} = require('axios')
const unzip = require('yauzl')
const eventStream = require('event-stream')
const keys = {
agency: ['agency_id'],
stops: ['stop_id'],
calendar: ['service_id'],
calendar_dates: ['date', 'service_id'],
routes: ['route_id'],
View react-button.js
import React from 'react'
import {
Animated, Image, IsNative, LoadPicture, Text, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'
export default class RoundButton extends React.Component {
constructor(props) {
this.state = {width: `${100/props.nbButtons}%`, height: `${100/props.nbButtons}%`,
fadeAnim: new Animated.Value(0), longPressHeight: 0}
this.measureButton = this.measureButton.bind(this)
libetl / benchmark.js
Last active Nov 29, 2017
View benchmark.js
const benchmark = ({theContestants, howManyTimes, forThisWork, barSettings, asText, logInConsole, seedInit}) => {
const timestamp = () => {
const hrTime = process.hrtime();
return hrTime[0] * 1000000 + hrTime[1] / 1000
const asNumbers = (name, duration) => `[${name.padStart(20)}]: ${`${(duration).toFixed(5)}`.padStart(15)} µs, ${`${((duration) / 1000).toFixed(0)}`.padStart(5)} ms, ${`${((duration) / 1000000).toFixed(2)}`.padStart(5)} s`
const asBar = (between0And1, histogramDisplay = barSettings) => {
const peak = between0And1 * histogramDisplay.width
const interval = histogramDisplay.width / histogramDisplay.gradient.length
libetl /
Created Oct 13, 2017
How to crash javac
public class TestExtendConsumer {
@FunctionalInterface public interface NumberConsumer<E extends Number> extends java.util.function.Consumer<E>{void accept(E number);}
private static <E extends Number> void extend(E number) {
public static void main(String[] args) {
NumberConsumer numberConsumer = TestExtendConsumer::extend;
libetl /
Last active Aug 31, 2017
How to parse a phone number with the google phone number util
import com.mycompany.mymodel.Phone;
import java.util.Locale;
import org.apache.commons.lang3.StringUtils;
import static;
You can’t perform that action at this time.