Skip to content

Instantly share code, notes, and snippets.

@hosuaby
hosuaby / signature.commands.ts
Created December 3, 2021 20:34
Draw signature on signature_pad (canvas) in Cypress tests
import {random} from 'lodash-es';
/**
* This is a command to draw a random signature on the canvas of signature_pad
* (https://github.com/szimek/signature_pad) during Cypress tests.
*
* Put the present into `<project root>/cypress/support/commands/signature.commands.ts`.
* Add `import './commands/signature.commands';` in `<project root>/cypress/support/index.ts`.
*
* After, you will be able to draw random signatures with:
@gaearon
gaearon / index.html
Last active February 13, 2024 09:46
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@Integralist
Integralist / docker-machine-mac-osx.md
Last active May 3, 2019 12:05
Docker Machine on Mac OS X

VirtualBox

  • https://www.docker.com/toolbox
  • docker-machine create --driver virtualbox dev
  • docker-machine env dev (add values to ~/.zshrc)
    • e.g. echo eval "$(docker-machine env dev)" >> ~/.zshrc
  • docker-machine ls
  • docker ps (might need to re-source .zshrc file; e.g. . ~/.zshrc)
  • docker run hello-world
  • docker-machine ip dev
@jshbrntt
jshbrntt / pan-zoom-image.js
Last active October 16, 2018 11:10
A simple way of panning and zooming an image using Hammer.js.
// <img id="myimage" src="http://placecage/1280/720">
var image = document.getElementById('myimage');
var mc = new Hammer.Manager(image);
var pinch = new Hammer.Pinch();
var pan = new Hammer.Pan();
pinch.recognizeWith(pan);
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf