Skip to content

Instantly share code, notes, and snippets.

View mmmeff's full-sized avatar
🦁
Legacy Wrastlin'

Matt mmmeff

🦁
Legacy Wrastlin'
View GitHub Profile
@mmmeff
mmmeff / 00-ReactToolFactory.tsx
Last active April 15, 2024 13:47
A simple Typescript-forward utility that spits out Editor.js tools for React components. You may need to include relevant Context providers for your application as wrappers around whatever <Component> is rendered by the factory
// Based on https://walkthrough.so/pblc/QCawSCKwOQLn/creating-a-custom-editorjs-block-tool-with-react
import type {
API,
BlockAPI,
BlockTool,
BlockToolConstructorOptions,
} from '@editorjs/editorjs'
import ReactDOM from 'react-dom'
@mmmeff
mmmeff / install-node-js.sh
Last active April 4, 2017 18:57 — forked from ankurk91/install-node-js.sh
Install node js and npm on Ubuntu/Mac using nvm
#!/bin/bash
# Install node and npm via nvm - https://github.com/creationix/nvm
# Run this script like - bash script-name.sh
# Prevent source
[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo -e "\e[91m This script is being sourced, will exit now \e[39m" && return
# Script will auto terminate on errors
set -e
.super-element {
&__inner-stuff {
width: 69px;
}
@media screen and (max-width: 760px;) {
&__farts {
height: 10px;
}
}
@mmmeff
mmmeff / ng-svg.js
Created January 27, 2015 02:14
Quick little SVG injector in Angular. Uses Snap-svg, so make sure it's included in your project.
var app = angular.module('myApp');
app.factory('Snap', [
function () {
return window.Snap;
}
]);
app.directive('ngSvg', function (Snap) {