Skip to content

Instantly share code, notes, and snippets.

View nloding's full-sized avatar

Nathan Loding nloding

View GitHub Profile
@nloding
nloding / formula-config.json
Created May 17, 2022 15:33
Masking data with Reactors
{
"name": "Mask Data - Example",
"description": "Mask custom data with a Reactor",
"type": "private",
"code": "module.exports = async function (req) {\n const mask = (str, mask, n = 1) => \n ('' + str).slice(0, -n)\n .replace(/./g, mask)\n + ('' + str).slice(-n)\n\n const { data } = req.args\n\n return {\n raw: mask(data)\n }\n}",
"configuration": [
],
"request_parameters": [
{
"name": "data",
@nloding
nloding / index.html
Created April 19, 2020 01:47
Tailwind Trello Clone
<!-- credit: https://tailwindcomponents.com/component/trello-panel-clone -->
<div class="bg-blue w-full h-screen font-sans">
<div class="flex p-2 bg-blue-dark items-center">
<div class="hidden md:flex justify-start">
<button class="bg-blue-light rounded p-2 font-bold text-white text-sm mr-2 flex">
<svg class="fill-current text-white h-4 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M41 4H9C6.24 4 4 6.24 4 9v32c0 2.76 2.24 5 5 5h32c2.76 0 5-2.24 5-5V9c0-2.76-2.24-5-5-5zM21 36c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2V12c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v24zm19-12c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2V12c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v12z"/></svg>
Pannels
</button>
<input type="text" class="bg-blue-light rounded p-2">
</div>
@nloding
nloding / cloudSettings
Last active April 13, 2020 13:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-03-04T21:37:36.930Z","extensionVersion":"v3.2.5"}
@nloding
nloding / asyncSetTimeout.js
Created March 14, 2018 14:51
async wrapper for setTimeout
// credit: https://codingwithspike.wordpress.com/2018/03/10/making-settimeout-an-async-await-function/
async function wait(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
// usage:
@nloding
nloding / selectComponent.js
Created January 17, 2018 19:10
formik with react-select
// @flow
import { compose, isNull, map, omit } from 'lodash/fp';
import React from 'react';
import styled from 'react-emotion';
import ReactSelect from 'react-select';
import { mapProps, withHandlers } from 'recompose';
import 'react-select/dist/react-select.css';
const StyledReactSelect = styled(ReactSelect)`
&.is-focused .Select-control {
@nloding
nloding / react-app-file-structure
Created February 16, 2016 17:49 — forked from mrtnbroder/react-app-file-structure
React Directory Structure
.
├── assets
│   ├── images
│   ├── sass/less/stylus/css
├── lib
│   ├── actions
│   ├── components
│   │   ├── __tests__
│   │   │ └── Avatar.test.jsx
│   │   └── Avatar.jsx
@nloding
nloding / UUID.php
Created February 4, 2016 21:36 — forked from dahnielson/UUID.php
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@nloding
nloding / lolbandwidth.py
Created February 1, 2016 21:00 — forked from atucom/lolbandwidth.py
automatically log speedtest results to file with timestamp for logging.
#!/usr/bin/python
#stolen and modified from the reddit post about the raspbeery pi tweeting at comcast
#run this every 10 minutes (or w/e) with cron:
#"crontab -e"
#*/10 * * * * /home/pi/lolbandwidth.py
import os
import sys
import csv
import datetime
import time
@nloding
nloding / INSTALLATION.md
Created January 26, 2016 02:47 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content