Skip to content

Instantly share code, notes, and snippets.

View joanroig's full-sized avatar
👋

Joan joanroig

👋
View GitHub Profile
@joanroig
joanroig / Raspberry Pi NodeJS setup.md
Last active May 25, 2021 20:32
Raspberry Pi NodeJS setup

nodejs

sudo apt-get update
sudo apt-get dist-upgrade
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

yarn

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
@joanroig
joanroig / Raspberry Pi setup.md
Last active May 25, 2021 20:26
Raspberry Pi 24/7 setup

Raspberry Pi 24/7 setup

Easy steps to recreate a reliable Raspberry Pi running 24/7 which:

  • Will be able to restart tasks after a power outage
  • Periodically saves backups of selected folders in Google Drive
  • Can be easily restored after a SD card failiure
  • Can be accessed remotely

Preparing the SD card

@sindresorhus
sindresorhus / esm-package.md
Last active July 24, 2024 08:34
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@gsurrel
gsurrel / Galaxy_S8_Debloat.sh
Last active July 14, 2024 23:04
Samsung Galaxy S8 debloat list
###########################
# Phone apps and services #
###########################
adb shell "cmd package install-existing com.android.stk" # SIM toolkit
adb shell "cmd package install-existing com.android.stk2" # SIM toolkit (maybe for dual-sim devices)
adb shell "cmd package install-existing com.sec.android.app.simsettingmgr" # SIM card manager, maybe required, contains configuration and settings for handling dual SIM (give a SIM an icon, a name, and so on)
adb shell "pm uninstall -k --user 0 com.samsung.android.smartcallprovider" # The 4th tab in the Phone app for 'local places'
adb shell "pm uninstall -k --user 0 com.sec.vsim.ericssonnsds.webapp" # NSDSWebApp. The Non Sim Device Solution (NSDS) is linked to VoLTE and VoWifi (Wifi Calling). NSDS allows connecting non sim devices to IMS core: https://uk.linkedin.com/in/hemant-kumar-dewnarain-2b779679
adb shell "pm uninstall -k --user 0 com.android.cts.ctsshim" # Part of the Android Compatibility Test Suite: https://source.android.com/compatibility/cts/setu
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active July 24, 2024 09:32
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@euikook
euikook / Logger.ts
Last active November 2, 2022 16:19
Winston, Typescript, Logger
import * as winston from 'winston';
import * as colors from 'colors/safe';
import { LEVEL } from 'triple-beam';
import * as util from 'util';
export class Logger {
myFormat:any = winston.format.printf((info) => {
return `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`;
});
@maxkostinevich
maxkostinevich / invoice.js
Last active June 23, 2024 08:54
PDFMake.js - Invoice Markup
// Invoice markup
// Author: Max Kostinevich
// BETA (no styles)
// http://pdfmake.org/playground.html
// playground requires you to assign document definition to a variable called dd
// CodeSandbox Example: https://codesandbox.io/s/pdfmake-invoice-oj81y
var dd = {