Skip to content

Instantly share code, notes, and snippets.

View ecklf's full-sized avatar
💫
流星

Florentin / 珞辰 ecklf

💫
流星
View GitHub Profile
@ecklf
ecklf / lodash-webpack-plugin+0.11.5.patch
Created December 11, 2020 08:53
lodash-webpack-plugin webpack 5 patch
diff --git a/node_modules/lodash-webpack-plugin/lib/index.js b/node_modules/lodash-webpack-plugin/lib/index.js
index d791223..2aca193 100644
--- a/node_modules/lodash-webpack-plugin/lib/index.js
+++ b/node_modules/lodash-webpack-plugin/lib/index.js
@@ -84,13 +84,17 @@ function () {
/* Webpack >= 4 */
if (compiler.hooks) {
+ const webpackVersion = parseInt(require('webpack/package.json').version, 10)
+
@ecklf
ecklf / mp4.sh
Created July 14, 2020 05:20 — forked from djotto/mp4.sh
Merge multiple mp4 files as chapters
#! /usr/bin/env bash
####################################################
# Required Libraries
#
# library name | commands used | verified version
# ------------------------------------------------
# ffmpeg | ffmpeg/ffprobe | 3.1.4 3.2
# gpac | mp4box | 0.6.1
# mp4v2 | mp4chaps | 2.0.0
@ecklf
ecklf / mock-snippet.ts
Last active June 30, 2020 06:12
Mock OAuth2Client for testing (google-auth-library)
import { LoginTicket, OAuth2Client, TokenPayload } from "google-auth-library";
const mockTokenPayload: TokenPayload = {
//...
}
const mockVerifyIdToken = ({
idToken,
}: {
idToken: string;
@ecklf
ecklf / webpack.config.js
Last active August 1, 2019 19:15
webpack config - figma plugin + tailwindcss
const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
module.exports = (env, argv) => ({
mode: argv.mode === "production" ? "production" : "development",
// This is necessary because Figma's 'eval' works differently than normal eval
devtool: argv.mode === "production" ? false : "inline-source-map",
const bucket = admin.storage().bucket(testEnv.storageBucket);
const file = bucket.file(mockObject.name);
const contents = JSON.stringify(mockObject, null, 2);
file.save(contents, function(err) {
if (!err) {
// file written
}
});
@ecklf
ecklf / delete-all-messages.js
Created December 13, 2018 06:57 — forked from IMcPwn/delete-all-messages.js
Delete all messages in a Discord channel
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Copy / paste the below script into the JavaScript console.
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages).
var before = 'LAST_MESSAGE_ID';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, "");
const channel = window.location.href.split('/').pop();
create2DArray(rows, columns) {
var x = new Array(rows);
for (var i = 0; i < rows; i++) {
x[i] = new Array(columns);
}
return x;
}
#!/bin/bash
parentdir="$(dirname `pwd`)/games/"
for i in $parentdir*; do
for a in \\ \| \/ -; do echo -en "\r$a"; sleep 0.05; done;
hashed=$(node schemaHash.js $i);
rm -r $i/schema-*/ 2> /dev/null
mkdir -p $i/schema-$hashed/{en,de};
cp $i/data-de-latest.json $i/schema-$hashed/de/data-de-latest.json;
cp $i/data-en-latest.json $i/schema-$hashed/en/data-en-latest.json;
done
@ecklf
ecklf / randompi.py
Last active September 7, 2021 09:26
A simple script to calculate pi with random generated numbers using python3.
__author__ = 'ecklf'
# IMPORT
import random
# VAR
random.seed()
radius = 424242
loops = 10000
counter = 0