Skip to content

Instantly share code, notes, and snippets.

@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@jankuca
jankuca / examples.js
Created January 1, 2011 13:49
JS library for converting MongoDB-like selectors to SQL
// Basic usage
mongo2sql({ 'a': 'b', 'c': 'd' });
"[a] = 'b' AND [c] = 'd'"
mongo2sql({ 'a': { $gt: 123 }, 'c': 'd' });
"[a] > 123 AND [c] = 'd'"
mongo2sql({ $or: [{ 'a': 'b'}, { 'c': 'd' }] });
"( ( [a] = 'b' ) OR ( [c] = 'd' ) )"