Skip to content

Instantly share code, notes, and snippets.

View rvanmil's full-sized avatar

René van Mil rvanmil

View GitHub Profile
@peschee
peschee / esm-package.md
Created July 22, 2021 12:14 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from 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. 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.
# test directories
__tests__
^(?!@serverless/enterprise-plugin/).*test.*$ # fix for serverless-enterprise
tests
powered-test
*.test.js
*.tap.js
*.test.ts
*tests.html
@fabianfett
fabianfett / Change Xcode version in GitHub Actions
Created August 21, 2019 09:37
How to change the Xcode version in GitHub Actions
# Change Xcode version in GitHub Actions
As of today (2019-08-21) I haven't found any documentation on changing Xcode versions when
using GitHub actions. So I checked the applications folder and everything we need is
already there. 🤩
```
> ls -n /Applications/ | grep Xcode*
lrwxr-xr-x 1 0 80 30 Aug 2 19:31 Xcode.app -> /Applications/Xcode_10.2.1.app
drwxr-xr-x 3 501 20 96 Oct 20 2018 Xcode_10.1.app
@LeonardoCardoso
LeonardoCardoso / GPG-Tower
Last active April 21, 2023 11:53
How to setup Tower to use the GPG Suite
# GPG on Tower
@nestserau
nestserau / AtomicInteger.swift
Last active October 6, 2022 12:12
Atomic way to operate on integers in Swift. Inspired by Java's AtomicInteger
/// This is free and unencumbered software released into the public domain.
///
/// Anyone is free to copy, modify, publish, use, compile, sell, or
/// distribute this software, either in source code form or as a compiled
/// binary, for any purpose, commercial or non-commercial, and by any
/// means.
///
/// In jurisdictions that recognize copyright laws, the author or authors
/// of this software dedicate any and all copyright interest in the
/// software to the public domain. We make this dedication for the benefit
@danharper
danharper / normalize-filenames.js
Last active August 17, 2018 19:32 — forked from dcramer/normalize-filenames.js
use Sentry (Raven) on PhoneGap
Raven.config(dsn, {
dataCallback(data) {
const normalize = filename => filename.split('/www/', 2)[1]
data.exception.values[0].stacktrace.frames.forEach(frame => {
frame.filename = normalize(frame.filename)
})
data.culprit = data.exception.values[0].stacktrace.frames[0].filename
@kristopherjohnson
kristopherjohnson / LowPassFilterSignal.swift
Last active April 2, 2023 00:54
Simple implementation of low-pass filter
struct LowPassFilterSignal {
/// Current signal value
var value: Double
/// A scaling factor in the range 0.0..<1.0 that determines
/// how resistant the value is to change
let filterFactor: Double
/// Update the value, using filterFactor to attenuate changes
mutating func update(newValue: Double) {
@mculp
mculp / voices.txt
Created December 3, 2014 00:14
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.

Here's how you validate a mailgun webhook in Node.js (as per the mailgun docs for securing webhooks)

'use strict';

var scmp = require('scmp')
  , crypto = require('crypto')
  . mailgunPrivateKey = 'XXXXXXXXXXXXX'
  , mailgunTokens = {}
  , mailgunExpirey = 15 * 60 * 1000