Skip to content

Instantly share code, notes, and snippets.

View leny's full-sized avatar
🧐
Think less. Stupid more.

Pierre-Antoine Delnatte leny

🧐
Think less. Stupid more.
View GitHub Profile
syntax: glob
*~
._*
.DS_Store
.sass-cache
tmp
node_modules
bower_components
*.sublime-workspace
@leny
leny / mq-demo.js
Last active February 20, 2019 20:16
Using media queries in react with emotion and koutla-swiss
import React from "react";
import {css} from "emotion";
import {mq} from "koutla-swiss";
const styles = {
text: css({
color: "black",
...mq("min-width: 480px", {
color: "red",
}),
const randomWait = (delay) => new Promise((resolve, reject) => {
setTimeout(() => {
if (Math.round(Math.random() * 2) % 2) {
resolve("ok");
} else {
reject(new Error("wrong!"));
}
}, delay * 1000);
});
import db from "../core/db-manager";
db.collection("users")
.findAll()
.then((allUsers) => Promise.all(
allUsers.map( user => user.update({badge: new Badge("hellow")})
)
)
)
.then((result) => {})
const randomWait = (delay) => new Promise((resolve, reject) => {
setTimeout(() => {
if (Math.round(Math.random() * 2) % 2) {
resolve("ok");
} else {
reject(new Error("wrong!"));
}
}, delay * 1000);
});
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@leny
leny / .eslintrc.js
Created January 20, 2019 17:09
Config files for Prettier & ESLint @ BeCode
/* becode/PROJECT_NAME
*
* /.eslintrc.js - ESLint configuration
*
* coded by leny@BeCode
* started at 18/01/2019
*/
"use strict";
@leny
leny / exo.js
Last active December 7, 2018 21:14
random exo
//console.log(TABLE_DATA)
function init(){
const tableau = document.getElementsByTagName('tbody')[0];
const sortBtn = document.getElementById('sort');
sortBtn.setAttribute('type', 'submit');
const stopRandomBtn = document.getElementById('stop');
stopRandomBtn.setAttribute('type', 'submit');
const startRandomBtn = document.getElementById('start');
startRandomBtn.setAttribute('type', 'submit');

Installer docker

Pour commencer, nous devons installer docker sur nos machines :

  • Sur macOS, suivez la procédure expliquée sur cette page
  • Sur windows, suivez la procédure expliquée sur cette page
  • Sur Linux, suivez la procédure expliquée sur cette page

Pour tester votre installation, lancez la commande docker run hello-world.

const getGeolocationFromAddress = ({city, position: {latitude, longitude}}) => {
if (latitude && longitude) {
return `${city} (${latitude}, ${longitude})`;
}
return `${city}`;
};