Skip to content

Instantly share code, notes, and snippets.

View manuartero's full-sized avatar
🧩

Manuel Artero Anguita manuartero

🧩
View GitHub Profile
@manuartero
manuartero / exact-versions.cjs
Created June 30, 2025 14:22
replace caret with exact version on the package.json
#!/usr/bin/env node
/* node exact-versions.cjs */
'use strict';
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('../package.json'));
const lock = JSON.parse(fs.readFileSync('../package-lock.json'));
['dependencies', 'devDependencies'].forEach(section => {
{
"compilerOptions": {
/* type checking */
"strict": true, // turn on strict mode family
"noFallthroughCasesInSwitch": true, // every switch case should break or return
/* modules */
"baseUrl": "src", // base path for imports
"module": "ESNext", // ESModules & allows «import.meta»
"moduleResolution": "Node", // recommended: ts mimic node resolution
"resolveJsonModule": true, // allows .json files
@manuartero
manuartero / jest.config.mjs
Created May 27, 2025 17:20
jest.config.mjs
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
/** @type {import('jest').Config} */
const config = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ["src/**"],
@manuartero
manuartero / functional-interfaces.md
Created August 11, 2017 12:24
Java 8 Functional Interfaces
Java Human
Consumer<T> (t) -> void
BiConsumer<T,U> (t, u) -> void
Supplier<R> () -> r
Function<T,R> (t) -> r
BiFunction<T,U,R> (t, u) -> r
Predicate<T> (t) -> boolean
BiPredicate<T,U> (t, u) -> boolean
@manuartero
manuartero / log.sh
Created December 14, 2015 16:34
log path_to_log_file
#!/bin/bash
# $1 path_to_log_file
if [ -z "$1" ] ; then
echo "log {path_to_log_file}"
exit 1
fi
tail -f -n 10000 $1 | awk '
/DEBUG/ {print "\033[36m" $0 "\033[39m"}