Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
@voxpelli
voxpelli / apple-crossover-patch.diff
Last active June 7, 2023 17:34
Highlighted diff of the patch that Apple applies to CrossOver in the Game Porting Toolkit here: https://github.com/apple/homebrew-apple/blob/main/Formula/game-porting-toolkit.rb
This file has been truncated, but you can view the full file.
diff --git a/include/distversion.h b/include/distversion.h
new file mode 100644
index 00000000000..b8a3724b76b
--- /dev/null
+++ wine/include/distversion.h
@@ -0,0 +1,12 @@
+/* ---------------------------------------------------------------
+* distversion.c
+*
+* Copyright 2013, CodeWeavers, Inc.
@voxpelli
voxpelli / module-type-badges.md
Created August 5, 2022 17:14
A selection of shield.io badges to indicate module type

Badges

Pick the right one and add to your repo to show what kind of module it is

Module type: ESM

[![Module type: ESM](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://nodejs.org/api/esm.html)
@voxpelli
voxpelli / all.txt
Created October 26, 2021 10:44
Takes a Blue Oak Council Copyleft JSON file and outputs it in a format that can be copy and pasted into the GitHub organization insights query https://blueoakcouncil.org/copyleft.json
license:CDDL-1.0
license:CDDL-1.1
license:CPL-1.0
license:EPL-1.0
license:EPL-2.0
license:ErlPL-1.1
license:IPL-1.0
license:LGPL-2.0-only
license:LGPL-2.0-or-later
license:LGPL-2.1-only
@voxpelli
voxpelli / README.md
Last active August 9, 2022 18:52
my starship config

This is my config for the Starship cross-shell prompt.

// My own take
const JSON_ESCAPE = {
'&': '\\u0026',
'>': '\\u003e',
'<': '\\u003c',
'\u2028': '\\u2028',
'\u2029': '\\u2029'
};
@voxpelli
voxpelli / .zshrc
Created August 13, 2021 13:34
My history setup in zsh
# **** History setup ****
setopt EXTENDED_HISTORY
# share history across multiple zsh sessions
setopt SHARE_HISTORY
# append to history
setopt APPEND_HISTORY
# adds commands as they are typed, not at shell exit
setopt INC_APPEND_HISTORY
# expire duplicates first
@voxpelli
voxpelli / template-tag-factory.js
Created January 22, 2020 14:58
A small little helper for creating a template tag where one can modify the static strings, the values and/or the final output in some way. Eg. trim some whitespaces?
/**
* @template T
* @param {T} value
* @returns {T}
*/
const passthrough = value => value;
/**
* @param {object} [options]
* @param {(value: string) => string} [options.staticCallback]
// Used in real world eg. here: https://github.com/voxpelli/node-format-microformat/blob/5381268dbcdb1aef6a5757758710e4b9f75cbea3/index.js#L72-L78
// Works
/** @typedef {null|undefined|boolean|string|number|Array} NonObject */
/**
* @template T
* @typedef {T|Promise<T>} MaybePromised
@voxpelli
voxpelli / parse_fb_ua.js
Last active June 11, 2019 20:33
Experiment in parsing the extra data that Facebook sends in its User Agent string
const fbUserAgentPattern = /\]|(?:[\;\[](?=FB|$]))/;
const parseFbUserAgentOptions = (input) => input.split(fbUserAgentPattern)
.filter(text => text.startsWith('FB'))
.reduce(text => {
const [ name, value ] = text.split('/');
return { name, value };
}, result);
const prettifyFbUserAgentOptions = (fbUserAgentOptions) => fbUserAgentOptions.map(({name, value}) => name + ': ' + value).join('\n');
@voxpelli
voxpelli / gource-gravatar.js
Created June 26, 2018 15:02
Download Gravatars for all authors of a git repo and save in folder. Useful when combined with Gource. Node.js CLI script.
#!/usr/bin/env node
'use strict';
// Inspired by https://github.com/acaudwell/Gource/wiki/Gravatar-Example
const { execSync } = require('child_process');
const crypto = require('crypto');
const https = require('https');
const fs = require('fs');