Skip to content

Instantly share code, notes, and snippets.

Mark remarkablemark

Block or report user

Report or block remarkablemark

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View typescript-versus-flow.md

Why choose TypeScript over Flow? Because TypeScript has:

  • better performance,
  • larger community,
  • more type definitions,
  • more VSCode integrations,
  • more momentum.

Also, Facebook, the creator of Flow, are moving projects like Yarn and Jest over to TypeScript.

View NATO-phonetic-alphabet.md
Character Telephony
A Alpha
B Bravo
C Charlie
D Delta
E Echo
F Foxtrot
G Golf
H Hotel
@remarkablemark
remarkablemark / README.md
Last active Dec 24, 2019
Download file with Chrome using WebDriverJS
View README.md

Install

$ git clone https://gist.github.com/64a2603eca56df1baa835f64c8297472.git download && cd download
$ npm install

Usage

  1. Start server (in a shell):
@remarkablemark
remarkablemark / mysql-connect-docker-container-host.md
Created Nov 6, 2019
Connect to MySQL in docker container from host
View mysql-connect-docker-container-host.md

Connect to MySQL in container from host (without password):

mysql -h 127.0.0.1 -P 3306 -u root

Connect to MySQL in container from host (with password):

mysql -h 127.0.0.1 -P 3306 -u root -p
View remove-punctuation.js
var regex = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g
/**
* Removes punctuation from a string.
*
* @param {string} string
* @return {string}
*/
function removePunctuation(string) {
return string.replace(regex, '');
@remarkablemark
remarkablemark / binary_uuid.sql
Last active Oct 16, 2019
Convert between BINARY and UUID for MySQL <8
View binary_uuid.sql
DELIMITER //
CREATE FUNCTION BIN_TO_UUID(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE HEX CHAR(32);
SET HEX = HEX(b);
RETURN LOWER(CONCAT(LEFT(HEX, 8), '-', MID(HEX, 9,4), '-', MID(HEX, 13,4), '-', MID(HEX, 17,4), '-', RIGHT(HEX, 12)));
END
@remarkablemark
remarkablemark / phaser-add-resize-listener.js
Last active Oct 13, 2019
Helper function that resizes or scales a Phaser game canvas.
View phaser-add-resize-listener.js
/**
* Adds resize listener for game canvas.
*
* @example
* var game = new Phaser.Game(config);
* addResizeListener(game);
*
* @param {Phaser.Game} game - The game object.
* @param {HTMLCanvasElement} game.canvas - The canvas element.
* @return {Function} - The resize listener.
View kbd.md
<kbd>Space</kbd>

Space

@remarkablemark
remarkablemark / git-error.md
Last active Nov 20, 2018
git error: unordered stage entries in index
View git-error.md

After a failed rebase, I have the following error:

$ git status
fatal: unordered stage entries in index

To fix the error:

View crontab.md

crontab cheatsheet

crontab

Crontab syntax taken from guide:

* * * * * command
│ │ │ │ │
│ │ │ │ └─── day of week (0 - 6) (0 = Sunday, 6 = Saturday)
│ │ │ └──────── month (1 - 12)
You can’t perform that action at this time.