Skip to content

Instantly share code, notes, and snippets.

View olange's full-sized avatar
🌪️
mind abuzz, yet calm internal focus

Olivier Lange olange

🌪️
mind abuzz, yet calm internal focus
View GitHub Profile
@olange
olange / user.keymap
Created May 25, 2016 10:22
My LightTable settings (intended for a CH/FR keyboard layout)
;; User keymap
;; -----------------------------
[
[:editor "alt-w" :editor.watch.watch-selection]
[:editor "alt-shift-w" :editor.watch.unwatch]
[:app "pmeta-*" :workspace.show]
[:app "pmeta-/" :toggle-console]
[:app "pmeta-shift-/" :clear-console]
[:app "pmeta-alt-/" :console-tab]
@olange
olange / type-detective.coffee
Last active January 19, 2017 18:31
Reliably detect types of Javascript objects and primitive values, easing polymorphic programming in JS
#
# Helper module to reliably find the types of Javascript objects
# and primitive values, easing polymorphic programming.
#
# See also:
# * http://javascript.info/tutorial/type-detection
# * https://gist.github.com/olange/514325f6fe3d89610d224d731a2def9e
exp = module.exports = {}
#
@olange
olange / type-yatd.coffee
Created January 19, 2017 18:30
Yet another type detective – CoffeeScript version of the type `component/type` NPM package
#
# A less-broken `typeof` function. CoffeeScript version of the
# `component/type` NPM package [1].
#
# See also:
#
# [1] https://github.com/component/type/blob/master/index.js
# and https://gist.github.com/olange/2aa1abe1001c92bde78be1c84d7f1261
exp.type = (val) ->
toString = Object.prototype.toString
@olange
olange / graphqlScalarURLType.coffee
Created January 30, 2017 14:58
A custom GraphQL scalar type that represents an URL (Uniform Resource Locator) and promises to verify that a given URL string has a valid syntax.
exp = module.exports = {}
url = require "url"
type = require "component-type"
graphql = require "graphql"
graphql_language = require "graphql/language"
graphql_error = require "graphql/error"
{ GraphQLScalarType } = graphql
{ GraphQLError } = graphql_error
@olange
olange / google-firebase-functions-list-available-executables.js
Last active February 8, 2021 06:18
List of executables available in Firebase Cloud Functions Node.js runtime
/**
* List of executables in Cloud Functions runtime.
* Invoke with https://us-central1-‹project-name›.cloudfunctions.net/ls
*/
const functions = require( "firebase-functions");
const spawn = require( "child-process-promise").spawn;
const ls = (req, res) => {
console.log( "Listing contents of /usr/[local/][s]bin");
return spawn( "ls",
@olange
olange / keybase.md
Last active October 20, 2020 21:24
GitHub account ownership proof for Keybase

Keybase proof

I hereby claim:

  • I am olange on github.
  • I am olange (https://keybase.io/olange) on keybase.
  • I have a public key ASBzFUPXlmMy_SpQTjo49LfCtBcPz1FcBbrH8pGTLPxWVgo

To claim this, I am signing this object:

@olange
olange / sendAllDrafts.vba
Last active April 30, 2024 11:34
Sends all draft e-mails from a specific Outlook folder
Option Explicit
Private Const VERSION As String = "0.1"
Private Const DIALOG_TITLE As String = "yourModuleName › SendAllDrafts (v" & VERSION & ")"
' Name of the subfolder of the Drafts folder, containing the draft e-mails to be sent
Private Const MAILMERGE_SUBFOLDER_NAME = "MailMerge"
' Send all messages from the MAILMERGE_SUBFOLDER_NAME subfolder
' of the Drafts folder (ignores any subfolder)
@olange
olange / gh-backup.sh
Created October 5, 2025 13:14
GitHub to Synology DSM7 scheduled mirror backup script (aka scheduled sync)
#!/bin/bash
# GitHub repo + wiki mirror backup for Synology NAS
set -euo pipefail
# --- CONFIG ---
GITHUB_USER="${1:-${GITHUB_USER:-}}"
if [ -z "${GITHUB_USER}" ]; then
echo "Usage: $0 <github-user-or-org>"