Skip to content

Instantly share code, notes, and snippets.

View Amatewasu's full-sized avatar
🏃
At the run time

Alexis Delrieu Amatewasu

🏃
At the run time
View GitHub Profile
@Amatewasu
Amatewasu / hack_10fastfingersdotcom.js
Last active December 10, 2015 16:39
Hack for 10fastfingers.com
/*
Script pour http://10fastfingers.com/ by @Amatewasu - WTFPL
Vous devez coller ce script à chaque fois dans la console de votre navigateur. (ou simplement remettre n = 1 à chaque essai :-°)
Vous commencez par taper le premier mot puis sur espace pour soumettre un mot :)
*/
var input = document.getElementById("inputfield");
var els = document.querySelectorAll("#row1 span");
function foo (){
@Amatewasu
Amatewasu / node-allopass.js
Created March 23, 2013 18:21
Un petit script pour utiliser l'API d'allopass avec node.js
var http = require("http");
var express = require('express');
var app = express();
app.use(express.bodyParser());
app.use(express.methodOverride());
app.get("/", function (req, res){
var html = '';
html = '<form action ="http://payment.allopass.com/acte/access.apu" method="post">';
@Amatewasu
Amatewasu / compare_minify.js
Created May 3, 2013 12:47
Un petit script pour comparer le taille des sorties d'uglifyJS2. Dans le premier cas on donne des scripts déjà minifiés et dans l'autre des "versions de développements".
var UglifyJS = require("uglify-js");
var time = Date.now();
var compressed = UglifyJS.minify(["jquery-1.9.1.min.js", "raphael-min.js", "reqwest.min.js", "string.min.js", "humane.min.js", "underscore-min.js", "backbone-min.js", "angular.min.js", "three.min.js"])
compressedLength = compressed.code.length;
var uncompressed = UglifyJS.minify(["jquery-1.9.1.js", "raphael.js", "reqwest.js", "string.js", "humane.js", "underscore.js", "backbone.js", "angular.js", "three.js"]);
uncompressedLength = uncompressed.code.length;
var deltaTime = ((Date.now() - time) / 1000).toFixed(1);
@Amatewasu
Amatewasu / nb_chars.js
Created January 3, 2014 22:14
This little "quick & dirty" writed counts the number of characters of your tweets.
/*
* This little "quick & dirty" writed counts the number of characters of your tweets.
* Ce petit script codé rapidement et salement compte le nombre de caractères de vos tweets.
*
* How to use?
* 1) Download your Twitter archive
* 2) Install Node.js
* 3) Install the csv module, type: "(sudo) npm install csv"
* 4) Put this script in the uncompressed folder of your Twitter archive
* 5) Run the script, type "node nb_chars" in your terminal
@Amatewasu
Amatewasu / explanation.md
Created January 20, 2022 10:32
Cannot find module 'node:http`

Cannot find module 'node:http`

If you get this error, it is quite likely that you have a version of node that is < 14.18.0.

The node: notation has been introduced in node 14.18.0: https://nodejs.org/api/modules.html#core-modules To solve the issue, just upgrade node.

@Amatewasu
Amatewasu / layout-bmfont-text.d.ts
Last active April 26, 2023 14:24
layout-bmfont-text types
import { Font } from 'three/examples/jsm/loaders/FontLoader';
export type CreateLayout = (options: Partial<LayoutBfmFontOpts>) => LayoutBfmFont;
export interface LayoutBfmFontOpts {
/** the BMFont definition which holds chars, kernings, etc */
font: Font & {
common: {
/** the common line height */
lineHeight: number;
@Amatewasu
Amatewasu / log-all-promises.js
Last active September 25, 2023 12:58
log all promises
const allPromises = [];
class Promise2 extends Promise {
constructor(executor: (resolve, reject) => Promise2) {
super((resolve, reject) => {
return executor(resolve, reject);
});
allPromises.push(this);
}
}