Skip to content

Instantly share code, notes, and snippets.

@v-zo
v-zo / System Design.md
Created November 26, 2020 06:25 — forked from vasanthk/System Design.md
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?
@v-zo
v-zo / myCustomCommand.ts
Created November 18, 2020 12:28 — forked from NicholasBoll/myCustomCommand.ts
Adding Custom Cypress command
declare namespace Cypress {
interface Chainable<Subject> {
myCustomCommand(username: string, password: string): Cypress.Chainable<Response>
}
}
Cypress.Commands.add('myCustomCommand', (username: string, password: string) => {
Cypress.log({
name: 'loginByForm',
@v-zo
v-zo / CreateJob.sh
Created November 17, 2020 22:39 — forked from stuart-warren/CreateJob.sh
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@v-zo
v-zo / slim-redux.js
Created May 2, 2020 17:13 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@v-zo
v-zo / BackboneJS API fetch and parse
Created February 1, 2019 14:15 — forked from daniel-234/BackboneJS API fetch and parse
BackboneJS - Fetch data from an API and parse the response populating models inside a collection
About this gist
With this gist I wanted to freeze some concepts about BackboneJS that could
save some time in the future either to me if I needed to use this functionality
again, or to somebody else.
This implementation addresses the need to retrieve some data from an API and
to populate a BackboneJS collection accordingly, storing the retrieved items
as Models inside the Collection.
If you want to see this functionality built into an application, have a look