Skip to content

Instantly share code, notes, and snippets.

View rBurgett's full-sized avatar

Ryan rBurgett

View GitHub Profile
@rBurgett
rBurgett / nginx_site_config
Last active August 22, 2020 16:43
Sample NGINX site config for reverse proxy w/ forced TLS using Let's Encrypt certs
server {
# Port 80 is the default port for accepting HTTP connections
listen 80;
# These are the domain names (including subdomains) which this configuration will accept connections for
server_name mydomain.com;
# This line is for permanently redirecting to SSL/TLS
return 301 https://mydomain.com$request_uri;
}
@rBurgett
rBurgett / db.js
Created August 17, 2020 20:51
Indexed db module
import Dexie from 'dexie';
import * as uuid from 'uuid';
const { TableNames } = Constants;
class DBTable {
_name = '';
_db = null;
_table = null;
@rBurgett
rBurgett / mp_proposal.md
Last active August 1, 2020 16:02
MP Proposal

Project Pieces

  • Desktop Application - This where you will enter data. You will be able to add new episodes, blog posts, or modify site data (text, images, etc.). This will include all necessary data for generating your website, and can be used as a backup for the site itself along with having an option to export the data for separate backup as well. This same data could then be imported into the application (for example, if you move to a new computer).
  • Static site - This is a static site which is generated completely from the data entered in the desktop application. This will be the main show site. As a static site (meaning, unchanging files served as-is without having to generate dynamic files based on data from a database like WordPress), it will be able to be served extremely cheaply through a CDN. Since the entire site will be on a CDN, it will be able to handle an unlimited amount of traffic and never risk going down. It will also include a page where users can log in to post links. Eve
@rBurgett
rBurgett / horizontal_church_outline.md
Last active October 20, 2019 17:50
Horizontal Church Outline

Chapters:

  1. Marriage relationship As Prototype of the Church
    • Adam and Eve split from one person, in a horizontal relationship under God
  2. The Early Church’s Aversion to Titles
    • Matthew 23.8-10 "But you are not to be called 'Rabbi,' for you have one Teacher and you are all brothers. And call no one your 'father' on earth, for you have one Father, who is in heaven. Nor are you to be called 'teacher,' for you have one teacher, the Christ."
    • Galatians 2.6 "But from those who were influential (whatever they were makes no difference to me; God shows no favoritism between people) - those influential leaders added nothing to my message."
  3. Respect Is Earned
  4. Oversight Is About Accountability
  5. Leadership Is About Sacrifice
  6. Church Is a Lifestyle, Not a Weekly Service
@rBurgett
rBurgett / Contract.sol
Last active June 29, 2019 16:51
Ethereum Smart Contract example written in Solidity
contract MyContract {
// Declare persistent variables
uint256 public peopleCount = 0;
address owner;
mapping(uint => Person) public people;
modifier onlyByOwner() {
require(msg.sender == owner);
@rBurgett
rBurgett / gist:f568fa703dabc40396a8676ac5f11553
Last active November 21, 2018 18:26
Handling ipcMain events as Promises sequentially
// Renderer
(async function() {
ipcRenderer.removeAllListeners('something');
ipcRenderer.removeAllListeners('somethingElse');
// Set Promises to be resolved when the data comes in
const promises = [
new Promise(resolve => {
ipcRenderer.once('something', (e, res) => {
@rBurgett
rBurgett / react-bootstrap-exampls.jsx
Created January 7, 2017 16:10
An example of using React with Bootstrap styling
import React from 'react'; // or const React = require('react');
/*
The first this I do is figure out what I need to build. I know that I will need 1) a form
with an input, 2) a submit button and I'll be putting the names in a 3) list group. So,
I look those up on http://bootstrapdocs.com and find the following.
Forms - http://bootstrapdocs.com/v3.3.6/docs/css/#forms
Buttons - http://bootstrapdocs.com/v3.3.6/docs/css/#buttons
List Groups - http://bootstrapdocs.com/v3.3.6/docs/components/#list-group
@rBurgett
rBurgett / promises_and_generators_ examples.js
Last active December 26, 2016 19:23
Promises and generators examples for Jeff
const co = require('co');
// Asynchronous examples
// Callback function
setTimeout(() => {
console.log('This is a callback function!');
}, 100);
// Promise-returning function example
/**
* Here is another way to do the Game constructor. This uses a constructor function, but makes use of the function closure.
* You will notice that all the annoying .bind() calls are gone, because we are no longer using the `this` keyword to reference
* properties and methods. Rather than storing those as properties and methods on an object, I use shared variables inside
* the closure. The benefits of this design are that anything within the closure is private, so nobody can accidentally
* change those functions or values. Then, at the bottom we expose three items which can be accessed outside of the closure.
* If we were using ES6, we could also make many of the variable into constants, which would add another layer of protection
* and reduce the surface area for bugs. The downside is that this is not as fast as a traditional constructor, but when we
* are just talking about a couple milliseconds the speed difference is a non-issue! The only time it would mean anything is
* if you are calling thes
/**
* Here is another way to do the Game constructor. This is the traditional JS way of doing constructor functions
* The benefits are that this is the fastest way to construct and run a function. The downside is that all methods
* and properties are publicly available, which is a gross way to design classes. Also, you are still forced to
* often use .bind() in order to make the context is correct. But, regardless, if you look at many JS libraries,
* this is how you will find their classes structured.
*
* To run the constructor and instantiate the class:
* var game = new Game({
* levels: levels,