Skip to content

Instantly share code, notes, and snippets.

View sethbergman's full-sized avatar
🐋
Building Docker Images for Dell Technologies

Seth Bergman sethbergman

🐋
Building Docker Images for Dell Technologies
View GitHub Profile
@sethbergman
sethbergman / cloudSettings
Last active July 8, 2018 00:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-08T00:01:14.381Z","extensionVersion":"v2.9.2"}
#!/bin/bash
# <UDF name="hostname" label="The hostname for the new Linode" example="apps">
# <UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name" example="apps.example.com">
# <UDF name="adminuser" label="Username for new admin user (cannot be dokku)">
# <UDF name="adminpass" label="Password for new admin user">
# <UDF name="adminkey" label="SSH public key authorized for admin user (password SSH auth will be disabled)">
# <UDF name="dokkukey" label="SSH public key authorized for dokku user (used when deploying apps)">
# Turn off password authentication and root login for SSH
@sethbergman
sethbergman / ghost-helpers.hbs
Created April 24, 2018 13:50
Handlebars Ghost Helpers
// Get Posts Get Posts
// This will get the default number of blog posts (15)
{{#get "posts"}}
{{#foreach posts}}
//Add html for each post here
{{/foreach}}
{{/get}}
// Get all Posts Get all Posts
@sethbergman
sethbergman / keybase.md
Created April 24, 2018 06:20
sethbergman - keybase

Keybase proof

I hereby claim:

  • I am sethbergman on github.
  • I am sethbergman (https://keybase.io/sethbergman) on keybase.
  • I have a public key ASBjHXfozXkY4xQx-GhGOPg6SGVbwz4kNHPp3gDsWCdB_go

To claim this, I am signing this object:

@sethbergman
sethbergman / create_docs.py
Created March 28, 2018 15:27 — forked from mrexmelle/create_docs.py
Python script to generate documentation using Grip
import getopt
import re, shutil, tempfile
import os
import subprocess
import sys
# http://stackoverflow.com/questions/4427542/how-to-do-sed-like-text-replace-with-python
def sed_inplace(filename, pattern, repl):
'''
@sethbergman
sethbergman / heplers.js
Created March 5, 2018 22:08 — forked from ofstudio/heplers.js
Couple useful heplers for ghost
var hbs = require('express-hbs'),
api = require('core/server/api'),
_ = require('lodash'),
async = require('express-hbs/lib/async'), // To redefine `registerAsyncHelper`
registerAsyncHelper;
// Redefine `registerAsyncHelper` from `express-hbs`
registerAsyncHelper = function (name, fn) {
hbs.handlebars.registerHelper(name, function (context, options) {
// Pass `[context, options]` as arg instead of `context` only
@sethbergman
sethbergman / npx-api.js
Created February 14, 2018 09:42
npx API
#!/usr/bin/env node
const https = require('https')
const url = 'https://raw.githubusercontent.com/js-n/awesome-npx/master/README.md'
https.get(url, (res) => {
res.pipe(process.stdout)
})
.on('error', (e) => {
console.error(e)
process.exit(1)
})
@sethbergman
sethbergman / vimeo-oembed.html
Created January 18, 2018 15:09
Vimeo oembed sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vimeo Javascript oEmbed Example</title>
<script>
// This is the URL of the video you want to load
var videoUrl = 'http://www.vimeo.com/7100569';
@sethbergman
sethbergman / keybase.md
Created December 21, 2017 08:40
Keybase ID

Keybase proof

I hereby claim:

  • I am sethbergman on github.
  • I am sethbergman (https://keybase.io/sethbergman) on keybase.
  • I have a public key ASCp-bhX32N-75-BShEBtgfa4qEJyRALJf2XOs-1lLnjeQo

To claim this, I am signing this object:

@sethbergman
sethbergman / token-generator.js
Created October 26, 2017 11:29 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jwt');