Skip to content

Instantly share code, notes, and snippets.

View Bo-Duke's full-sized avatar
🌈
Doing some React apps I'll never publish

Maxime Bouveron Bo-Duke

🌈
Doing some React apps I'll never publish
View GitHub Profile
@Bo-Duke
Bo-Duke / table.js
Created August 27, 2019 12:46
Compare props and nextProps in console.table
const props2table = (props, nextProps, list) =>
Object.assign({}, ...Object.keys(props)
.filter(e => list.includes(e))
// .filter(e => props[e] !== nextProps[e])
.map(k => ({[k]: {props: props[k], nextProps: nextProps[k]}}))
);
console.table(props2table(this.props, nextProps, ['value']))
@Bo-Duke
Bo-Duke / extensions
Last active September 11, 2019 09:48
VS Code settings
aaron-bond.better-comments
ahmadawais.shades-of-purple
ashrafhadden.dracula-dot-min
bbenoist.QML
ChakrounAnas.turbo-console-log
dbaeumer.vscode-eslint
dotiful.dotfiles-syntax-highlighting
dracula-theme.theme-dracula
eamodio.gitlens
emmanuelbeziat.vscode-great-icons
@Bo-Duke
Bo-Duke / script.js
Last active December 5, 2018 13:22
Not on Marvel Unlimited
// hacky-hack
[...document.querySelectorAll('div.row-item.comic-item>div>a>img[src="https://i.annihil.us/u/prod/marvel/i/mg/b/40/image_not_available/portrait_uncanny.jpg"]')].map(e => e.parentElement.parentElement.parentElement.querySelector("h5>a").innerText)
#!/usr/bin/env python
import sys
import itertools
from math import sqrt
from operator import add
from os.path import join, isfile, dirname
from pyspark import SparkConf, SparkContext
from pyspark.mllib.recommendation import ALS
alias dps="docker ps -a --format \"$fg_bold[yellow]{{.Names}}${reset_color}($fg[magenta]{{.ID}}${reset_color}) {{ .Status }}\""
alias dpsl="docker ps -a --format \"table $fg_bold[yellow]{{.Names}}${reset_color}($fg[magenta]{{.ID}}${reset_color})\t$fg[blue]{{ .Image }}\t$fg[blue]{{ .Command }}\t$fg[blue]{{ .RunningFor }}${reset_color}\t$fg_bold[green]{{ .Status }}${reset_color}\t$fg[blue]{{ .Ports }}${reset_color}\""
@Bo-Duke
Bo-Duke / 0.open-all-links-in-firefox.md
Last active August 30, 2018 14:56
Open all Jenkins screenshots in Firefox
@Bo-Duke
Bo-Duke / screen-size.js
Last active May 4, 2018 11:30
Phone screen size calculator
// Human variables
const screenToBody = 82.9;
const height = 123.8;
const width = 58.6;
const ratioHeight = 19.5;
const ratioWidth = 9;
// Program variables
const x = screenToBody / 100;
const ratio = ratioHeight / ratioWidth;