Skip to content

Instantly share code, notes, and snippets.

View bodinsamuel's full-sized avatar
:shipit:

Samuel Bodin bodinsamuel

:shipit:
View GitHub Profile
@bodinsamuel
bodinsamuel / index.md
Created June 23, 2023 15:19
Find all node import without an extension

To easily migrate from CommonJS to ESM. NB: this does not fix implicit 'index.js' import

Find:

import(.*)('.?.?\/((.(?!\.js))*))';

Replace:

Clean Package.json before build

When installing for production or in docker, it's important to keep package.json light and use cache. When building you can not remove all devDependencies since some of them are useful for building but not all of them. This is also useful if you bump the version prop regularly. This script will clean up dependencies and returns only the mandatory fields. Adapt to your need ☺️

jq 'walk(
@bodinsamuel
bodinsamuel / ap_automatic.js
Last active May 12, 2017 19:13
AgoraPulse automatic interaction
/**
* This code will automatically like or comment instagram post in agorapulse interface
* Instead of recode a fullbot, I decided to use the free version of agorapulse and try to code a little script to automate interactions
* This is just a try, the code is dirty and it's likely to fail in the future.
*
*
* How to use, after you logedin agorapulse
* go to your instagram account > tab monitoring (assuming you are monitoring some hashtag)
* then >
*
@bodinsamuel
bodinsamuel / solver.md
Last active August 29, 2015 14:27
Problem Solver for Vagrant/VirtualBox

This files addresse solutions for guys like me that spend at least a full day trying to make a simple box working in windows I tried to categorize issues, but it's mostly random Theses are not processes to fully debug, it's just some tricks that might work. They have no relations to each other or some order that need to fullfiled

Connection Timeout

Use GUI mode

Most of connection timeout come from this. Add gui = true to your vagrantfile > vagrant reload

@bodinsamuel
bodinsamuel / gist:10117603
Created April 8, 2014 12:35
JS: Array of Color to Console
// When you have an array of color (in themes or whatever)
// You want to know whatit will display, but it's very boring to copy/paste in a color picker.
var color_array_to_console = function(array) {
console.log(array, 'There is ', array.length, ' colors');
for(var i = 0; i < array.length; i++)
console.log("%c███ " + array[i], "color: " + array[i] + ";");
};
color_array_to_console([