Skip to content

Instantly share code, notes, and snippets.


Adam Mackintosh agm1984

View GitHub Profile
frumbert / function.js
Created Aug 9, 2017
blob to dataurl, because I keep forgetting how to do it!
View function.js
function blobToDataURL(blob) {
return new Promise((fulfill, reject) => {
let reader = new FileReader();
reader.onerror = reject;
reader.onload = (e) => fulfill(reader.result);
sw-yx / react-router-state-manager.jsx
Last active Jul 26, 2022
Sync your state to your query params for copy-pastable state-in-URLs. React Router, Gatsby, and Svelte versions
View react-router-state-manager.jsx
// note - this was my rough working prototype, but still left some artifacts in the query params.
// todo: also need to debounce the history pushes
// see comments for production Gatsby and Svelte versions which delete nondefault keys in the query params
import React from 'react'
import queryString from "query-string"
export const connectRouterState = defaultURLState => Component => props => {
const { history, location } = props
// note: do not nest objects in URL state
tahirtaous / Add Custom CSS to Anchors links in WordPress
Last active Dec 12, 2021
How to Add Custom CSS Class Directly to Menu Item (Anchors) Links in WordPress Theme
View Add Custom CSS to Anchors links in WordPress
stas / vsftpd.conf
Created Feb 26, 2010
VSFTPD.CONF for virtual users with write/read/delete permissions
View vsftpd.conf
# VSFTPD.CONF for virtual users with write/read/delete permissions
gotnospirit / main.js
Created Jul 28, 2017
React Router v4 + React Transition Group v2
View main.js
import React from 'react'
import { render } from 'react-dom'
import { BrowserRouter, Route, Link } from 'react-router-dom'
import { TransitionGroup, Transition } from 'react-transition-group'
import matchPath from 'react-router-dom/matchPath'
const routes = [{
key : 'home',
path : '/',
content : 'Homepage',