Skip to content

Instantly share code, notes, and snippets.

@Platane
Platane / now-env.js
Last active Sep 18, 2019
add secret to now.sh
View now-env.js
const util = require("util");
const exec = util.promisify(require("child_process").exec);
require("dotenv").config();
const p = require("./now.json");
const vars = Object.entries({ ...p.env, ...p.build.env })
.filter(([, b]) => b[0] === "@")
.map(([a, b]) => ({
@Platane
Platane / setEnv.js
Created Jul 23, 2019
Set the env var in circle project from a .env file
View setEnv.js
const fs = require("fs");
const https = require("https");
/**
*
* Set the env var in circle project from a .env file
*
* usage:
*
* ```bash
View perf-radar.js
const N = 24;
const PI2 = Math.PI * 2;
const SIZE = 60;
const createSvgElement = elementName =>
document.createElementNS("http://www.w3.org/2000/svg", elementName);
/**
* prepare svg elements
*/
View arthur-brongniart.json
{
"experience": [
{
"company": {
"name": "Tracktl",
"logo_url": "https://media.licdn.com/media/AAEAAQAAAAAAAAXpAAAAJDI1ZWYzMzY4LWIzNmItNDE3ZC05ZTlmLTA4Mjk2OTA2MjY4Mg.png",
"linkedin_url": "https://www.linkedin.com/company-beta/3331997"
},
"media": [
{
@Platane
Platane / insaneJMad
Last active Sep 30, 2022
pizza tracker database
View insaneJMad
1664559508141 ---
1514638800000 947948051842392065 64
1512830853000 939506812537245696 63
1512240460000 937030524127858688 61
1510962093000 931668661995233280 59
1510676832000 930472193112276993 58
1509734051000 926517882317692928 55
1509655297000 926187562544304129 54
1509152942000 924080534430670848 53
1508370536000 920798884921720832 50
@Platane
Platane / cli
Created Mar 6, 2017
write flow anotation from jsdoc comment block
View cli
jscodeshift --parser flow -t .\transform.js .\src
@Platane
Platane / babel-plugin-require-absolute.js
Last active Oct 12, 2016
babel plugin to make absolute path relative in require statement
View babel-plugin-require-absolute.js
const fs = require('fs')
const pathUtils = require('path')
const fileExist = function( path ){
try{
fs.accessSync( path )
return true
} catch( err ){
return false
View gist:593e1d43df482c548e11
### Keybase proof
I hereby claim:
* I am platane on github.
* I am platane (https://keybase.io/platane) on keybase.
* I have a public key whose fingerprint is 9E65 C8B9 39A7 7443 979F E827 CAE3 8FA8 9A0E 15E9
To claim this, I am signing this object:
View gist:efbbe60bf326f905499b
#/bin/sh
# deploy script
# default options
incr="0.0.1"
versionMessage=""
# parse option
@Platane
Platane / gulpFile.js
Last active Aug 29, 2015
sort picture
View gulpFile.js
var ExifImage = require('exif').ExifImage
, sizeOf = require('image-size')
, fs = require('fs')
, Promise = require("Promise")
var cp = function( src , dst ){
return new Promise(function(resolve, reject){
var contentBuffer = fs.readFileSync(src)
fs.writeFile( dst, contentBuffer, resolve )