Skip to content

Instantly share code, notes, and snippets.

View 99darwin's full-sized avatar

Nick Saponaro 99darwin

View GitHub Profile
0x4a86bECCC2f7d1d9bfd0Fd66b6CF3A9b802804F6
Verifying my Blockstack ID is secured with the address 1PkhonJWSLg2mMwtKnGcKr94LDXU5EMyhm https://explorer.blockstack.org/address/1PkhonJWSLg2mMwtKnGcKr94LDXU5EMyhm
@99darwin
99darwin / README.md
Created June 19, 2018 19:24
Simple coinmarketcap API call

CoinMarketCap Query

Simple API call to CoinMarketCap for the USD price of DIVI.

Dependencies

npm i --save request request-promise lodash
@99darwin
99darwin / handlebars.index.js
Created July 14, 2018 19:11
Standard server setup using handlebars as a view engine
const
express = require('express'),
exphbs = require('express-handlebars'),
bodyParser = require('body-parser'),
path = require('path'),
app = express(),
routes = require('./routing/htmlRoutes'),
port = process.env.PORT || 3200;
app.use(bodyParser.json());
@99darwin
99darwin / custom-slack.css
Last active August 4, 2018 13:30
Custom dark theme for slack
body { background: ##2f3136; color: #dcddde; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@99darwin
99darwin / server.js
Created March 14, 2019 14:48
Express handlebars server with MongoDB
const express = require('express')
const mongoose = require('mongoose')
const exphbs = require('express-handlebars')
const bodyParser= require('body-parser')
const path = require('path')
const PORT = process.env.PORT || 1279
const app = express()
@99darwin
99darwin / WordPressAZ.md
Last active April 19, 2019 15:30
Setting up a WordPress site on Digital Ocean from A-Z

Prerequisites

This guide assumes that you already have some of the basics handled.

  1. A Digital Ocean account
  2. A Droplet running Ubuntu 18.04 deployed (but not set up)
  3. A domain (optional)
  4. Basic understanding of SSH
  5. Basic understanding of nano

NOTE: all items marked in bold are boilerplate and should be replaced with your own values.

@99darwin
99darwin / increaseWPFileSize.md
Created April 22, 2019 15:49
Increase max upload size for WordPress site manually

Motivation

You may want to increase the max upload size on your WordPress installation in order to upload a custom theme or larger media files.

Note: This will not work on shared hosting plans. This workaround is only for self-hosted WordPress installations.

How to

From your server, access the php.ini file under your PHP installation directory.

sudo nano /etc/php/<php_version>/apache2/php.ini
@99darwin
99darwin / cognito-to-ddb.js
Last active June 12, 2019 01:11
Add new Amazon Cognito users to DynamoDB with Lambda
var aws = require('aws-sdk');
var ddb = new aws.DynamoDB({apiVersion: '2012-10-08'});
exports.handler = async (event, context) => {
console.log(event);
let date = new Date();
const tableName = process.env.TABLE_NAME;
const region = process.env.REGION;
@99darwin
99darwin / cognito-to-ddb-test.json
Created June 12, 2019 01:12
Test request for Cognito to DynamoDB Lambda Function
{
"userName": "johnnysmith",
"request": {
"userAttributes": {
"email": "exampleuser@example.com",
"email_verified": true,
"name": "Johnny Smith",
"sub": "abcdevfefe-1232132-cofeve"
}
},