Skip to content

Instantly share code, notes, and snippets.

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

Mohammed Shah smashah

🏠
Working from home
  • I don't know, yno
  • LHR/JED
View GitHub Profile
@smashah
smashah / wa-magic.ts
Last active June 18, 2020 18:25
Easily get started with wa-automate
import {
create,
Client,
decryptMedia,
ev,
smartUserAgent
} from "@open-wa/wa-automate";
const mime = require("mime-types");
const fs = require("fs");
const ON_DEATH = require("death");
@smashah
smashah / starling_webhook_valid_express.js
Created January 14, 2020 17:01
Successfully validate a Starling Bank webhook signature
//https://stackoverflow.com/questions/56664705/nodejs-base-64-encoding-of-the-sha-512-digest/59738487#59738487
const express = require("express");
const crypto = require('crypto');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.json({
verify: (req, res, buf) => {
req.rawBody = buf

Keybase proof

I hereby claim:

  • I am smashah on github.
  • I am smashah (https://keybase.io/smashah) on keybase.
  • I have a public key ASCVdt4GK-eUVoNMs9fXiQPBOw-6MilFbZoRXhmXQ_X9MQo

To claim this, I am signing this object:

@smashah
smashah / remove_silence.ts
Last active June 3, 2024 08:24
A simple way to remove silences below a certain threshold in an audio file [NODEJS/TS]
//add this to your package.json
// "audio-buffer-utils": "^5.1.2",
// "audio-decode": "^1.4.0",
// "audiobuffer-to-wav": "^1.0.0",
// "node-lame": "^1.2.0",
// "ogg.js": "^0.1.0",
// "opus.js": "^0.1.1",
const fs = require('fs');
@smashah
smashah / flutter_firebase_codelabs_baby_names_main.dart
Last active January 30, 2019 22:12
A firebase & ListTile implementation that disables the tile within onTap during a transaction
import 'package:baby_names/my_list_tile.dart';
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(