Skip to content

Instantly share code, notes, and snippets.

View hitmands's full-sized avatar

Giuseppe Mandato hitmands

View GitHub Profile
@paulwib
paulwib / functional-cucumber-steps.js
Last active June 25, 2018 11:15
Functional Cucumber.js
const { defineStep } = require('cucumber');
const arity = require('util-arity');
/**
* Wrap a step function so it is passed the `world` scope as the first argument.
* Allows writing step definitions in a "purer" more functional style without
* worry about what `this` is, which is especially annoying when calling functions
* from other functions.
*
* Internal helpers expect world as the first argument, which is fine when they're
@meredian
meredian / lead_measures.md
Last active December 8, 2021 06:45
Compiled list of example lead measures for IT (in 4DX framework) which I found in numerous articles
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@patik
patik / how-to-squash-commits-in-git.md
Last active October 17, 2023 02:19
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@arschles
arschles / monorepo.md
Last active November 16, 2023 11:32
Why We Should Use Monolithic Repositories

I think we should have all our code in a monolithic repository.

I've detailed the big benefits to having one, addressed possible issues to having one, and mentioned a few risks to not moving to a monorepo below.

Benefits To Adopting a Monolithic Repo

Golang package dependencies

  1. Single vendor/ dir at the top level of deis/deis
  2. All internal packages use the same external dependencies

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@Avaq
Avaq / combinators.js
Last active March 18, 2024 20:49
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 9, 2024 08:18
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@staltz
staltz / introrx.md
Last active April 18, 2024 15:33
The introduction to Reactive Programming you've been missing