Skip to content

Instantly share code, notes, and snippets.

View rBurgett's full-sized avatar

Ryan rBurgett

View GitHub Profile
@rBurgett
rBurgett / nginx-ssl.conf
Created November 26, 2015 03:25
Configuration to get an A+ on the Qualys SSL Labs test with fast performing and low overhead SSL ciphers. Works in combination with nginx 1.6.0 full and OpenSSL v1.0.1i.
# I've used the configuration below for all my nginx instances and gotten an A+ on the Qualys SSL Test
# (https://www.ssllabs.com/ssltest/index.html). It satisfies requirements for PCI Compliance and
# FIPS. Includes OCSP Stapling (http://en.wikipedia.org/wiki/OCSP_stapling) and HTTP Strict Transport
# Security (http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security).
# - Not vulnerable to the Heartbleed attack.
# - Not vulnerable to the OpenSSL CCS vulnerability (CVE-2014-0224) with OpenSSL v1.0.1i 6 Aug 2014 & Nginx 1.6.0
# - SSL Handshake takes <80ms on most modern server hardware
# Use within the "server" scope among other directives
// Example #1, this has a problem
class MyComponet extends React.Component {
constructor(props) {
super(props);
this.state = {
selected: false
}
}
itemClicked(e) {
e.preventDefault();
// changes to APP.js
var APP = React.createClass({
...
render() {
return (
<div>
<Header title={this.state.title} status={this.state.status}/>
/**
* 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,
/**
* 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
@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
@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 / 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 / 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 / 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