Skip to content

Instantly share code, notes, and snippets.

View subversivo58's full-sized avatar
📧
For critical issues, send me an email

Lauro Moraes subversivo58

📧
For critical issues, send me an email
View GitHub Profile
const describe = (desc, fn) => {
console.log(desc)
fn()
}
const it = (msg, fn) => describe(' ' + msg, fn)
const matchers = (exp) => ({
toBe: (asssertion) => {
if (exp === assertion) {
@WesThorburn
WesThorburn / adding_wasm_MIME.md
Last active July 30, 2023 04:35
Webassembly, wasm files, webservers and MIME types

When compiling client files to webassembly, usually you'll end up with both .js and .wasm files. By default, most webservers don't know about the wasm MIME type. You'll likely see the following error: wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

Here is how to add the wasm MIME type (on linux systems, apache + nginx):

Open /etc/mime.types You'll see two columns, media type on the left, file type on the right Add the line application/wasm wasm

@joshuabaker
joshuabaker / languages.json
Last active April 30, 2024 17:07
List of languages with ISO 639-1 Alpha-2 codes in JSON.
[
{
"code": "aa",
"name": "Afar",
"native": "Afar"
},
{
"code": "ab",
"name": "Abkhazian",
"native": "Аҧсуа"
@AnalyzePlatypus
AnalyzePlatypus / lambda-gmail-compose.md
Created May 13, 2020 08:11
Use serverless function to send low-volume emails without 3rd party mail services.

Sending email with serverless functions

You can deploy this function on any of the serverless platforms - AWS Lambda, Google Cloud Functions, Azure Functions, Netlify, Cloudflare Workers, etc.

  1. Create a new function and paste in the following code.
  2. You will need to add nodemailer to your package.json (npm i nodemailer), and follow your platform's instructions on bundling dependencies.
  3. Obtain Gmail API credentials for your account. You will need clientID, clientSecret, and refreshToken. Follow this YouTube tutorial
  4. Expose these credentials as the follwing environment variables:
GMAIL_EMAIL_ADDRESS