Skip to content

Instantly share code, notes, and snippets.

@mohit2152sharma
mohit2152sharma / redis-cluster-local
Created January 18, 2024 06:10
Running Redis Cluster on macos locally
#!/bin/sh
# when installing redis from brew, it doesn't come with `utils` folder
# and because of which it's rather difficult to run redis cluster locally
# (`utils` folder has `create-cluster` script files, which automate the creation
# startup, stopping of redis cluster)
# this script is a workaround for that, basically, it checks if `utils` folder is
# there or not, if not, it downloads it and makes the necessary changes
# it assumes, you are running this on macos, with zsh shell
@craigcarlyle
craigcarlyle / a11y-linter.ts
Last active July 16, 2021 18:56
Cypress Accessibility Linter
function a11yLinter(tagName: string) {
return cy.window().then((win: any) => {
return new Cypress.Promise(function(resolve: any, reject: any) {
win.axe.run(tagName, (err: any, results: any) => {
if (err) {
reject(err);
}
resolve(results.violations);
});
});
@frobnitzem
frobnitzem / knapsack.js
Last active November 27, 2020 10:58 — forked from danwoods/knapsack.js
Knapsack algorithm in JavaScript
// Solve the knapsack problem using recursive descent.
// This wraps the actual solver below with a nice interface.
// It also handles non-integer cost, but then the complexity
// scales with the precision of the cost!
//
// obj is an object of named [cost, benefit] pairs, e.g.
// { banana: [5, 33],
// apple: [1, 12],
// kiwi: [1, 7]
// }
@ncase
ncase / common-project.md
Last active July 5, 2017 15:33
The Common Project Project (version 0.1)

A country that's polarized is paralyzed. If we want any change in the coming years, we need to find a way to work together. However, you can't just unify people by holding hands and singing Kumbaya. No – rather than ignore or "put aside" our differences, let's use our different perspectives & interests & skills to tackle problems from all possible angles! For us to find common ground, we first need to find common goals.

This is the Common Project project.

Below, you'll find a list of projects, people, organizations, books, talks, movies, articles, and ideas that cross partisan lines to solve The Big Problems we face today. There's many such problems. And we'll need help from all sides.


@wavezhang
wavezhang / java_download.sh
Last active April 25, 2024 22:52
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@marcysutton
marcysutton / enzyme-test.js
Last active August 23, 2021 08:20
React A11y Testing
import {expect} from 'chai';
import App from '../app/components/App';
import a11yHelper from "./a11yHelper";
describe('Accessibility', function () {
this.timeout(10000);
it('Has no errors', function () {
let config = {};
@afeld
afeld / civictech.md
Last active April 2, 2024 15:45
civic tech jobs in NYC (or remote)
@vasanthk
vasanthk / System Design.md
Last active April 26, 2024 01:02
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@squarism
squarism / iterm2.md
Last active April 25, 2024 03:50
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@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