Skip to content

Instantly share code, notes, and snippets.

View jobrac's full-sized avatar
🏠
Working from home

Jobel Racines jobrac

🏠
Working from home
View GitHub Profile
@jobrac
jobrac / README.md
Created August 17, 2023 06:25 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@jobrac
jobrac / esm-package.md
Created July 22, 2023 10:44 — forked from sindresorhus/esm-package.md
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.
@jobrac
jobrac / deb11vaultwardenInstall.md
Created March 3, 2023 13:51
Debian 11 Vaultwarden install (no docker)
@jobrac
jobrac / tcpproxy.js
Created January 7, 2023 08:03 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}
@jobrac
jobrac / create_triggers
Created September 18, 2022 13:35 — forked from colophonemes/create_triggers
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@jobrac
jobrac / jobelrac
Last active March 5, 2022 05:42
My info
### Jobel Racines
![Jobrac's github stats](https://github-readme-stats.vercel.app/api?username=jobrac&theme=prussian&show_icons=true)
@jobrac
jobrac / mock-brands-response.json
Created December 13, 2021 07:32
mock-brands-response.json
{
"error":false,
"code":"",
"data":{
"rows":[
{
"id":"61b2dd222047e24e1b739fe2",
"name":"Acer",
"image":[],
"product_count" : 200,
@jobrac
jobrac / service.js
Created August 6, 2021 13:42 — forked from cadebward/service.js
Remove `__v` and `_id` from MongoDB
import mongoose, {Schema} from 'mongoose'
export const ServiceSchema = new Schema({
displayName: {type: String, required: true, unique: true}
})
ServiceSchema.set('toObject', {
transform: function (doc, ret) {
ret.id = ret._id
delete ret._id
@jobrac
jobrac / index.js
Created July 22, 2021 13:42 — forked from joshbeckman/index.js
An example Node.js server that can verify a Shopify webhook's integrity. Run with `node index.js`.
const PORT = 3000;
const SECRET = 'APP_SHARED_SECRET';
var http = require('http'),
crypto = require('crypto'),
server;
function verifyShopifyHook(req) {
var digest = crypto.createHmac('SHA256', SECRET)
.update(new Buffer(req.body, 'utf8'))
@jobrac
jobrac / pinpoint-amplify.js
Created July 12, 2021 07:24 — forked from wesww/pinpoint-amplify.js
AWS JS libs without an Amplify backend
import Auth from '@aws-amplify/auth'
import Analytics from '@aws-amplify/analytics'
Auth.configure({
region: 'us-east-1',
identityPoolId: 'us-east-1:xxxx...',
})
Analytics.configure({
AWSPinpoint: {
appId: 'appIdKey',
region: 'us-east-1'