Skip to content

Instantly share code, notes, and snippets.

View jrichardsz's full-sized avatar

JRichardsz jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / setup_sshkeys.sh
Created January 19, 2016 17:31 — forked from cedricziel/setup_sshkeys.sh
Openshift git wrapper script creation for being able to use private git repos
#!/usr/bin/env bash
# copy this script to your gear, make it executable and run it once
# make the appropriate directory
mkdir -p "$OPENSHIFT_DATA_DIR/.ssh"
# generate a key
ssh-keygen -q -t rsa -f $OPENSHIFT_DATA_DIR/.ssh/id_rsa -N ""
@jrichardsz
jrichardsz / 0-react-hello-world.md
Created May 20, 2016 16:50 — forked from danawoodman/0-react-hello-world.md
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@jrichardsz
jrichardsz / gist:0b7f55ae9ab2441135c54a29690af9ba
Created July 8, 2016 15:34 — forked from ivan-loh/gist:ee0d96c3795e59244063
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb
@jrichardsz
jrichardsz / install-comodo-ssl-cert-for-nginx.rst
Created July 14, 2016 20:48 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jrichardsz
jrichardsz / API.md
Last active July 20, 2023 15:03 — forked from iros/API.md
Documenting your REST API, api docs, apidocs, restdocs, http spec, documentation, wiki

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@jrichardsz
jrichardsz / pandoc.css
Created April 6, 2017 20:10 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@jrichardsz
jrichardsz / curl.md
Last active May 27, 2021 23:43 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jrichardsz
jrichardsz / gist:63e9ebf6a03fa944ef44027acb68e276
Created December 11, 2017 16:59 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@jrichardsz
jrichardsz / node-and-npm-in-30-seconds.sh
Created December 25, 2017 12:21 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jrichardsz
jrichardsz / nodejs-basic-auth.js
Last active March 16, 2018 14:20 — forked from kwhinnery/app.js
HTTP Basic Authentication with Express 4 using the http-auth module
var express = require('express'),
auth = require('http-auth');
// Configure basic auth
var basic = auth.basic({
realm: 'SUPER SECRET STUFF'
}, function(username, password, callback) {
callback(username == 'admin' && password == 'f00lpr00f');
});