Skip to content

Instantly share code, notes, and snippets.

Régis Gaidot rgaidot

Block or report user

Report or block rgaidot

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
rgaidot / TextWithCR.js
Last active Aug 28, 2019
Text with carriage returns without dangerouslySetInnerHTML #react
View TextWithCR.js
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
const TextWithCR = ({ text }) => {
const lines = text.split('\n');
return (
{ => (
<Fragment key={line}>
View useStateFetch.js
import { useState, useEffect } from 'react';
const render = data => match =>
data.pending ? match.pending()
: data.error ? match.error(data.error)
: ?
: null;
export const useStateFetch = url => {
const [data, setData] = useState({ pending: true });
View k8s-ecr-refresh.yml
apiVersion: batch/v1beta1
kind: CronJob
name: ecr-cred-helper
namespace: default
concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
rgaidot / the-basics-of-JavaScript-with-arrays.js
Created Jul 17, 2018
The basics of JavaScript with Arrays
View the-basics-of-JavaScript-with-arrays.js
// Code Challenge #11: JavaScript Functional Programming
// ARRAY 1
const texasss = [{
name: 'Mike',
age: 23,
gender: 'm',
us: false,
rgaidot / gist:72e34ca92f62382e7b9c18afc06b5762
Created Jun 16, 2017 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:72e34ca92f62382e7b9c18afc06b5762


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
rgaidot / compose-install.service
Created Jan 28, 2017
Docker Compose on CoreOS
View compose-install.service
Description=Docker Compose on CoreOS
View The Three Go Landmines.markdown

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
rgaidot /
Created Sep 12, 2016 — forked from JamesMGreene/
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

rgaidot / post-merge
Created May 25, 2016 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
rgaidot /
Created May 24, 2016
Build RancherOS for Raspberry Pi
git clone
cd os/scripts/images/rpi-hypriot
docker build -f Dockerfile.dapper --pull -t rancheros/rpi .
docker run -ti --privileged -v `pwd`/scripts/ -v `pwd`/dist:/source/dist rancheros/rpi
echo ---
echo Done!
echo Now you can unzip in os/scripts/images/rpi-hypriot/dist
You can’t perform that action at this time.