Skip to content

Instantly share code, notes, and snippets.

// Convert "translate(10px) rotate(0)" into ["translate", "rotate"]
// This helps interpolate strings of different arity.
const keyRegex = /(?:^| )([\w-]+)\(([^ ,]+(?:(?:,[ ]*|[ ]+)[^ ,)]+)*)\)/g
/**
* Create a specialized interpolator for strings like:
*
* "translate(...) rotate(...)"
*/
@dtmrc
dtmrc / debug.js
Created September 12, 2021 01:55 — forked from aleclarson/debug.js
const debug = (name, val) => {
console.log(name, val)
return val
}
const debugFn = (name, fn) => {
return (...args) => {
console.log(name + ':arguments %O', args)
const result = fn(...args)
@dtmrc
dtmrc / es6.js
Created September 12, 2021 01:55 — forked from aleclarson/es6.js
// Search an array for nested arrays and inline them
const flatten = (arr, out = []) => {
arr.forEach(val => {
if (val == null) return
if (Array.isArray(val)) flatten(val, out)
else out.push(val)
})
return out
}
From 92e2a0844b1e12b5d2ad9febbd76e3efa75d81bd Mon Sep 17 00:00:00 2001
From: aleclarson <[email protected]>
Date: Thu, 20 Dec 2018 12:34:32 -0500
Subject: [PATCH] ci: use semantic-release
---
.travis.yml | 19 +++++++++++++++++++
package.json | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 .travis.yml
{
// Editor
// Controls whether the editor shows CodeLens.
"diffEditor.codeLens": false,
// When enabled, the diff editor ignores changes in leading or trailing whitespace.
"diffEditor.ignoreTrimWhitespace": true,
// Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.
module.exports = [
'014a',
'0x706272',
'13steinj',
'2bdb2',
'_3442',
'__crackers__',
'_selfishPersonReborn',
'a_redditor',
'Aceeri',

(This is an excerpt from a much longer paper I'm writing about code quality and maintaining FOSS projects.)

FOSS dependency scoring

In an effort to improve the quality of search results on sites like https://npmjs.com, there has been more and more discussion about factoring in the ranking/scoring of dependencies to influence search results. The general idea is that a library should be ranked not only on its own merits, but dependencies should weigh into the score as well.

I’m not sure what my opinion is on this yet. I was initially in favor of this, and still might be, but this document is a summary of some things that crossed my mind about the topic.

Should dependencies weigh into the search score for a library?

Guide to Contributing to Enquirer

Welcome!

Thanks for choosing to contribute to Enquirer! We're so happy that you're contributing to open source projects, and we're even happier that one of those projects is ours!

Teamwork

There is no faster, more effective way to improve a product than from the feedback from the first experience of a new user -- Jon Schlinkert

@dtmrc
dtmrc / tcc-reset.py
Created September 15, 2021 01:39 — forked from haircut/tcc-reset.py
Completely reset TCC services database in macOS
#!/usr/bin/python
"""
Completely reset TCC services database in macOS
Note: Both the system and individual users have TCC databases; run the script as both
a user and as root to completely reset TCC decisions at all levels.
2018-08-15: Resetting the 'Location' service fails; unknown cause
2018-08-16: Confirmed the 'All' service does not really reset _all_
services, so individual calls to each service is necessary.
@dtmrc
dtmrc / modify-system-preferences-authorizations.py
Created September 15, 2021 02:13 — forked from haircut/modify-system-preferences-authorizations.py
Backs up authdb, then modifies them so users can modify Energy Saver, Network, Printers & Scanners, Date & Time, Time Machine
#!/usr/bin/python
'''
Modifies authorizations database to allow standard users to change select
system preferences.
A great guide to available authorization rights can be found at:
https://www.dssw.co.uk/reference/authorization-rights/index.html
USE AT YOUR OWN RISK
'''