Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
{
"prjs": {
"en": [
0,
3172950,
1097195,
563594,
354525,
245394,
183313,
This file has been truncated, but you can view the full file.
{
"prjs": {
"en": [
0,
3172950,
1097195,
563594,
354525,
245394,
183313,
@ogiermaitre
ogiermaitre / oloo.js
Created October 11, 2018 09:16
[Prototype tips] Some fun with javascript prototy #javascript
const house = {
set houseColor(color){
this.color = color
},
toString(){
return this.color
}
}
const myHouse = Object.create(house)
@ogiermaitre
ogiermaitre / .eslintrc.js
Last active May 17, 2018 12:56
[Some eslint tips] #javascript #eslint #node #es6
module.exports = {
'env': {
node: true,
es6: true,
browser: true,
},
'extends': [
'airbnb-base',
'eslint:recommended',
],
@ogiermaitre
ogiermaitre / d3_modules.js
Last active October 5, 2018 15:47
[d3 tips] #d3v4 #d3 #javascript #browser
import { scaleOrdinal, scaleLinear, schemeCategory20, scaleSqrt, scaleTime } from 'd3-scale'
import { arc, lineRadial, curveCardinalClosed, line, curveMonotoneX, linkHorizontal } from 'd3-shape'
import { select, selectAll, event } from 'd3-selection'
import { hierarchy, partition,tree } from 'd3-hierarchy'
import { format } from 'd3-format'
import { range, max, bisector } from 'd3-array'
import { zoom, zoomIdentity } from 'd3-zoom'
import { geoPath } from 'd3-geo'
import { json } from 'd3-request'
import { timeFormat } from 'd3-time-format'
@ogiermaitre
ogiermaitre / package.json
Last active March 12, 2018 14:37
[Semantic ui boilerplace]
{
"name": "frontendv2",
"version": "1.0.0",
"description": "",
"main": "font-fix.js",
"scripts": {
"start": "webpack-dev-server --config webpack.config.js --host 0.0.0.0 --devtool source-map",
"build": "webpack -p --config webpack.conf.js",
"lint": "eslint src"
},
@ogiermaitre
ogiermaitre / gist:aff60eb85bb128b1fbbc020c1bd22759
Last active March 8, 2018 16:07
[Accent Folding in Javascript] #javascript
const accent_map = {
'ẚ': 'a', 'Á': 'a', 'á': 'a', 'À': 'a', 'à': 'a', 'Ă': 'a', 'ă': 'a', 'Ắ': 'a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[bml3 docker] #docker #express #mongodb
version: '3'
services:
db:
image: "ogiermaitre/mongodb"
volumes:
- "./mongodb/db/:/data/db/"
- "./mongodb/seed_data:/mnt/data/"
ports:
- "27017:27017"
@ogiermaitre
ogiermaitre / moduleVSscript.js
Created January 12, 2018 09:24
[Modules dev tricks] #node #javascript #es6
const __main__ = () => {
}
const __module__ = () => {
module.exports = {}
}
if (!module.parent) {
@ogiermaitre
ogiermaitre / keysDeep.js
Created January 11, 2018 09:28
[keysDeep lodash] #javascript #node #lodash #es6
_.mixin({
keysDeep: (object) =>
_.keys(object).reduce((o, k) =>
[
...o,
...(_.isObject(object[k]) && !_.isArray(object[k])) ?
_.keysDeep(object[k]).map(e => `${k}.${e}`) : [k]],
[])
})