Skip to content

Instantly share code, notes, and snippets.

@smebberson
smebberson / README.md
Last active July 25, 2022 23:57
Devspace installation

This repository is intended to be run on a brand new computer.

Requirements

Please note: macOS is our only supported environment.

  • MacOS
  • Git

Everything else will be installed for you.

@smebberson
smebberson / DismissableAlert.js
Created October 17, 2018 22:24
A dismissible alert based on smooth-ui Alert.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Alert, Box } from '@smooth-ui/core-sc';
class DismissableAlert extends Component {
constructor (props) {
super(props);
@smebberson
smebberson / validation-rules.js
Last active May 3, 2017 00:01
Example validation rules
'use strict';
/**
* Member Api schema.
* @return {Object} Mongoose model object.
*/
const memberApiSchema = () => {
const schema = new mongoose.Schema({
active: { type: String, required: true, enum: ['true', 'false'] },
@smebberson
smebberson / stack.yml
Created March 20, 2017 09:25
Koding stack
# Here is your stack preview
# You can make advanced changes like modifying your VM,
# installing packages, and running shell commands.
provider:
digitalocean:
access_token: '${var.digitalocean_access_token}'
resource:
digitalocean_droplet:
@smebberson
smebberson / xkey.js
Created March 8, 2017 22:02
x-key header
/**
* Helper function to create an api key
* @param {String} data The string to encrypt
* @return {String} The sha256 hash result
*/
function createHmac (data) {
const crypto = require('crypto');
const hmac = crypto.createHmac('sha256', config.get('appSecret'));
hmac.update(data);
@smebberson
smebberson / docker-compose.yml
Created June 10, 2016 01:21
Zero configuration Consul cluster
version: '2'
services:
consul:
image: smebberson/alpine-consul
consului:
image: smebberson/alpine-consul-ui
ports:
- 8500:8500
@smebberson
smebberson / index.html
Created April 18, 2016 23:00
phonegap
<!DOCTYPE html>
<!--
Copyright (c) 2012-2016 Adobe Systems Incorporated. All rights reserved.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@smebberson
smebberson / .gitignore
Last active October 27, 2022 21:50
Nodejs static web server boilerplate
.DS_Store
node_modules/
@smebberson
smebberson / index.html
Created August 1, 2012 10:07
Drawing a Google Map using pixel space
<!DOCTYPE html>
<head>
<meta chartset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Scott Mebberson">
<title>scottmebberson.com example</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="http://scottmebberson.com/css/examples.css" type="text/css" media="screen">