Skip to content

Instantly share code, notes, and snippets.

Jeremy Combs jmcombs

Block or report user

Report or block jmcombs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fb_appsecret_proof.js
// To secure Facebook Graph API requests:
// - Create a SHA256 hash of your App's Access Token using the App's 'Secret' as the key
// - The hashed value then needs to be added to an 'appsecret_proof' parameter on each Graph API call request
// - Toggle 'Require App Secret' to 'ON' in App dashboard Developer Portal
// Require 'crypto' package as part of Node
const crypto = require('crypto');
// Create HMAC object:
// - Algorithim: 'SHA256'
@jmcombs
jmcombs / .editorconfig
Last active Jun 23, 2019
Base Node App with Express using Prettier and ESLint Airbnb Style
View .editorconfig
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespae = true
insert_final_newline = true
@jmcombs
jmcombs / new-git-project.md
Last active Apr 23, 2019
Using `git` and [GitHub](https://github.com) to create a new Project
View new-git-project.md

Creating a New Git(Hub) Project

These are the steps I follow for:

  • Creating a new project locally on my Mac and on Github
  • Locally initializing the project with npm and git
  • Linking the local and GitHub projects
  • Performing the initial commit
  • Pushing to Github

Assumptions:

@jmcombs
jmcombs / base64.md
Last active Apr 23, 2019
Using `base64` for encoding and decoding on macOS
View base64.md
  • base64 encode:

    This example is for encoding a username and password (You would replace username and password with the actual username and password):

    echo -n 'username:password' | base64

  • base64 decode

    This example is decoding the username and password example above. It can be used to decode any base64 encoded text:

@jmcombs
jmcombs / openssl.md
Last active Oct 14, 2019
Using `openssl` on macOS for various certificate functions
View openssl.md
  • Check a CSR:

    Verify the CSR and print CSR data filled in when generating the CSR

    openssl req -verify -in mycsr.csr -noout -text

  • Check a Certificate:

    Check a certificate and return information about it (signing authority, expiration date, etc.):

@jmcombs
jmcombs / app.yaml
Last active Apr 17, 2019
Various references for when I am using Google's App Engine for NodeJS
View app.yaml
runtime: nodejs10
handlers:
- url: /.*
script: auto
secure: always
redirect_http_response_code: 301
env_variables:
DEBUG: "app,app:*"
@jmcombs
jmcombs / installing-node.md
Last active Jun 20, 2019
This is for installing NodeJS (which includes NPM) for macOS and properly configuring it for secure use not requiring `sudo`.
View installing-node.md
  1. Download & Install LTS NodeJS Package from here

  2. Create new Directory for NPM and Global Packages:

    mkdir ~/.npm-packages

  3. Configure NPM to use the new directory:

    npm config set prefix ~/.npm-packages/

  4. Create or Modify ~/.bash_profile or ~/.zshrc and add the following:

You can’t perform that action at this time.