Skip to content

Instantly share code, notes, and snippets.

View remarkablemark's full-sized avatar

Mark remarkablemark

View GitHub Profile
@remarkablemark
remarkablemark / phaser-toss-the-turtle-demo.js
Created April 26, 2024 19:00
Phaser: Toss the Turtle prototype
class Example extends Phaser.Scene
{
preload() {
this.load.image('backdrop', 'assets/pics/platformer-backdrop.png');
this.load.image('cannon_head', 'assets/tests/timer/cannon_head.png');
this.load.image('cannon_body', 'assets/tests/timer/cannon_body.png');
this.load.spritesheet('chick', 'assets/sprites/chick.png', { frameWidth: 16, frameHeight: 18 });
}
create() {
@remarkablemark
remarkablemark / evernote_error.html
Created April 26, 2024 15:57
Evernote stack error
<code class="_dYGX5IbclMlrl5HlKg8"><div class="RKd5EvdcekLoOHmadYH7 Cls16K72bxF5uWu0_fT8 E_lbv7gA85FrFeRroPBY">Error: Could not trigger Notes Limit Phase 2 Paywall</div><div>Component Stack:</div><div>The above error occurred in task anonymous</div><div> created by takeLatest(GrowthFeatures/TRIGGER_NOTES_LIMIT_PHASE_TWO_IF_ELIGIBLE, )</div><div> created by nje</div><div>Tasks cancelled due to error:</div><div>takeLatest(GrowthFeatures/TRIGGER_NOTES_LIMIT_PHASE_TWO_IF_ELIGIBLE, )</div><div>takeLeading(App/LOG_OUT, uO)</div><div>takeLeading(modals/backup_modal_submit, )</div><div>takeLatest(App/HOVER_TO_SET_DRAWER, )</div><div>takeLatest(App/SET_COLOR_THEME, )</div><div>takeLeading(App/WAIT_TILL_SYNC, )</div><div>takeEvery(Debug/CRASH_SAGA, mO)</div><div>takeLeading(APP/HANDLE_SHOW_RELEASE_NOTES_MODAL, )</div><div>takeLatest(App/NAVIGATE_TO, )</div><div>takeLatest(AllNotes/SELECT_ALL_NOTES, IAe)</div><div>takeLatest(AllNotes/SELECT_ALL_NOTES_VIEW, )</div><div>takeLatest(AllNotebooks/SELECT_ALL_NOTEBOOKS,
@remarkablemark
remarkablemark / Dockerfile
Last active April 24, 2024 13:40
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@remarkablemark
remarkablemark / crontab.md
Created October 13, 2018 04:26
crontab cheatsheet

crontab cheatsheet

crontab

Crontab syntax taken from guide:

* * * * * command
│ │ │ │ │
│ │ │ │ └─── day of week (0 - 6) (0 = Sunday, 6 = Saturday)
│ │ │ └──────── month (1 - 12)
@remarkablemark
remarkablemark / add.amd.js
Last active February 11, 2024 23:13
Example of creating an AMD module using `define()`.
define(function() {
/**
* Add one or more numbers.
*
* @param {...number}
* @return {Number} - The sum or 0.
*/
function add() {
var sum = 0;
var num;

You would do the same thing except after renderHook():

await act(() => {
  const [myMutation] = result.current;
  myMutation(/* your args */);
});

expect(result.current[1]).toEqual({
 // your object
docker system df
docker system prune -a -f --volumes
docker volume rm $(docker volume ls -qf dangling=true)
@remarkablemark
remarkablemark / hide-status-bar-in-iphone-simulator.md
Created July 13, 2016 00:16
How to hide the status bar in the iPhone Simulator.

Hide status bar in iPhone Simulator

  1. Open Info.plist.
  2. Add row with key View controller-based status bar appearance and value NO if not present.
  3. Add row with key Status bar is initially hidden with value YES if not present.
  4. Save and run the project.

Source

function hash(string) {
const utf8 = new TextEncoder().encode(string);
return crypto.subtle.digest('SHA-256', utf8).then((hashBuffer) => {
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray
.map((bytes) => bytes.toString(16).padStart(2, '0'))
.join('');
return hashHex;
});
}