Skip to content

Instantly share code, notes, and snippets.

@metamaker
metamaker / 2019-https-localhost.md
Created Mar 6, 2020 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains
View 2019-https-localhost.md

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@metamaker
metamaker / jquery-delete-event.js
Last active Aug 23, 2017
Example of how to accurately detach your event from jQuery handlers.
View jquery-delete-event.js
const table; /* DOM Element that reacts to resize event */
// Initialize table
const __sync = () { /* some happy crappy code */ };
$(window).on('resize', null, {
type: 'sticky-table-handler',
table: table
}, __sync);
__sync();
@metamaker
metamaker / SingleFileUpload.js
Created Aug 6, 2017
Simple React file input for admin-on-rest that supports uploading of exactly one file and automatically encodes uploads to base64
View SingleFileUpload.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Dropzone from 'react-dropzone';
import {translate} from 'admin-on-rest';
import FileInputPreview from "admin-on-rest/lib/mui/input/FileInputPreview";
const defaultStyle = {
dropZone: {
background: '#efefef',
@metamaker
metamaker / platformio-ide-terminal-init.md
Last active Jan 9, 2017
Automatic initialization of terminals on start in `Atom` with `platformio-ide-terminal` plugin.
View platformio-ide-terminal-init.md
# Automatic initialization of terminals on start in `Atom` with `platformio-ide-terminal` plugin.
# Script was tested with `Atom` 1.12.9 and `platformio-ide-terminal` 2.2.2.
#
# Author: metamaker <https://github.com/metamaker>
#
# How to install:
# 1. Add this script to Atom's `init.coffee`.
# 2. Write your actual terminals configuration to `terminals` variable.