Skip to content

Instantly share code, notes, and snippets.

Cyril Auburtin caub

Block or report user

Report or block caub

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 PropsType.ts
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this:
View .light
#!/bin/bash
regexp='^[-+]?[0-9]*(\.[0-9]*)?$'
validateNumber() {
if [[ $1 == *[0-9]* && $1 =~ $regexp ]]; then
echo "$1"
else
printf >&2 '%s is not a valid number\n' "$1"
fi
}
View .gitconfig
[user]
email = cyril.auburtin@gmail.com
name = caub
[alias]
a = add --all
au = add -u
b = branch
br = branch -r
amend = commit --amend -C HEAD
@eunomie
eunomie / README.md
Created Apr 27, 2017
How to send containers log to ELK using gelf log driver
View README.md

Send docker logs to ELK through gelf log driver

There's so many way to send logs to an elk... logspout, filebeat, journalbeat, etc.

But docker has a gelf log driver and logstash a gelf input. So here we are.

Here is a docker-compose to test a full elk with a container sending logs via gelf.

@phillip-haydon
phillip-haydon / jsonb_merge.sql
Created Dec 6, 2016
Deep Merge two jsonb documents in PostgreSQL
View jsonb_merge.sql
CREATE OR REPLACE FUNCTION jsonb_merge(left JSONB, right JSONB) RETURNS JSONB AS $$
var mergeJSON = function (target, add) {
function isObject(obj) {
if (typeof obj == "object") {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return true; // search for first object prop
}
}
@ebidel
ebidel / fancy-tabs-demo.html
Last active Apr 3, 2020
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
View fancy-tabs-demo.html
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@staltz
staltz / introrx.md
Last active Apr 4, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@rwaldron
rwaldron / array.build.md
Last active Sep 30, 2019
Array.build(length, mapFn = undefined)
View array.build.md
@Zirak
Zirak / helloWorld.js
Last active Apr 16, 2018
The Hello World of the future
View helloWorld.js
/*
* The Hello World of tomorrow
* Copyright (C) 2012 Scruffy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
You can’t perform that action at this time.