Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Murray jashmenn

View GitHub Profile
@jashmenn
jashmenn / dynamic_forms_builder.sql
Created Aug 19, 2020 — forked from firmanelhakim/dynamic_forms_builder.sql
Dynamic Forms Builder using PostgreSQL
View dynamic_forms_builder.sql
CREATE TABLE master.forms
(
form_id serial NOT NULL,
code CHARACTER VARYING,
name CHARACTER VARYING,
description CHARACTER VARYING,
properties jsonb,
audit_trails jsonb,
stereotype CHARACTER VARYING,
sort_order INTEGER,
View rubiks-cube.md

Cubes:

Get a speedcube, they're way more fun. Do not buy original Rubiks cube brand.

Learning

Start with the "Beginners Method". Like anything, you might have to try a few different resources before you "get it".

@jashmenn
jashmenn / s3-upload-node.js
Created Mar 23, 2020
Simple example of uploading to S3 from the filesystem with Node.js - If you're trying to learn how to do this, checkout Fullstack Node.js https://newline.co/fullstack-nodejs
View s3-upload-node.js
const fs = require('fs')
const AWS = require('aws-sdk')
const { promisify } = require('util')
const s3 = new AWS.S3()
s3.uploadP = promisify(s3.upload)
const params = {
Bucket: 'fullstack-printshop',
Key: 'profile-photos/thedude.jpg',
Body: fs.createReadStream('thedude.jpg')
}
@jashmenn
jashmenn / generatePath.js
Last active Mar 6, 2020
Deconstruction of the curves on @Wattenberger's Thinking in Hooks Post
View generatePath.js
// This code is from: https://github.com/Wattenberger/Wattenberger-2019/blob/07024a820011988f5fbefed21161b1111f38e710/src/components/Blog/posts/Hooks/Hooks.jsx#L451-L470
// It generates the SVG path for the curve between two lines on the post "Thinking in React Hooks", located here: https://wattenberger.com/blog/react-hooks
//
// It's a good idea to pull up the documentation on SVG paths here: https://www.w3.org/TR/SVG/paths.html
//
// As you may know, SVG paths are specified by a string where a
// letter is the "command" and the numbers following are the "arguments"
//
// We'll be using 4 commands:
//
@jashmenn
jashmenn / redirect-url-s3.sh
Created Sep 27, 2018
Use S3 as a url short-linker / redirection service
View redirect-url-s3.sh
#!/bin/bash -x
if [[ $# -eq 0 ]] ; then
echo 'Usage: cmd <s3 path> <redirect-location>'
echo 'e.g.'
echo 'redirect-url-s3.sh www.fullstackreact.com/r/react-from-zero-satisfaction https://nate177.typeform.com/to/PTJ9ZI'
exit 0
fi
S3_PATH=$1
@jashmenn
jashmenn / geth-and-remix.scpt
Created Nov 16, 2017
open geth and remix in tabs via applescript
View geth-and-remix.scpt
-- osascript services.scpt
tell application "iTerm 3"
activate
set myterm to (create window with default profile)
tell myterm
set mysession to (current session)
tell mysession
set name to "geth"
write text "cd ~/projects/fs/newline/newline-content-internal/fullstack-web3/private-net"
write text "./bin/geth --datadir=./datadir --nodiscover --rpc --rpcapi \"db,personal,eth,net,web3,debug\" --rpccorsdomain='*' --rpcaddr=\"localhost\" --rpcport 8545 --ws --wsapi \"db,personal,eth,net,web3,debug\" --wsorigins='*' --wsaddr=\"localhost\" --wsport 8546 console"
View gist:9b45a4ecab360aefef84d9ebc6cf0495
Verifying my Blockstack ID is secured with the address 1EZ6kY8mCk1sPj4n1qbsZh6YFCRNsUaMy1 https://explorer.blockstack.org/address/1EZ6kY8mCk1sPj4n1qbsZh6YFCRNsUaMy1
@jashmenn
jashmenn / final-cut-it-out.js
Created Sep 21, 2017
Remove Silence from Final Cut Pro clips, automatically, using ffmpeg timecodes and OSX JavaScript Automation - Demo: https://imgur.com/a/Zisav
View final-cut-it-out.js
#!/usr/bin/env osascript -l JavaScript
/**
* Delete silence from Final Cut Pro timeline using a script.
* Demo: https://imgur.com/a/Zisav
*
* This script accepts an ffmpeg silencedetect log as input.
*
* To setup, have fcp running along with your clip selected. Ensure that the
* timecode will start at zero before running this script. That is, if your clip
@jashmenn
jashmenn / vending-machine-smart-contract.js
Last active Dec 27, 2017
Pseudocode for a vending machine "smart contract" in JavaScript
View vending-machine-smart-contract.js
/**
* A pseudo VendingMachine "smart contract" in JavaScript
*
* See: https://newline.co
**/
class VendingMachine {
constructor() {
this.price = 50; // 50 cents for any soda
this.balance = 0; // number of cents paid so far
this.selection = null; // name of selected drink
View genesis.json
{
"config": {
"chainId": 101,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
You can’t perform that action at this time.