Skip to content

Instantly share code, notes, and snippets.

Parameters:
Env:
Description: An environment name that will be prefixed to resource names
Type: String
AllowedValues: ["development", "production"]
resources:
NetworkRole:
Type: "AWS::IAM::Role"
Properties:
@kevinold
kevinold / serverless-deploy-user.yaml
Created June 5, 2019 17:20 — forked from bsamuel-ui/serverless-deploy-user.yaml
Cloudformation template to deploy permissions for deploying a serverless project.
AWSTemplateFormatVersion: 2010-09-09
Description: >
Constructs a managed IAM policy to deploy a serverless project.
This template assumes the stack is being deployed in the current region and account.
You can then attach this policy to other IAM objects, such as users or roles.
Based on the work done in: https://github.com/serverless/serverless/issues/1439
@kevinold
kevinold / editPage.js
Created June 4, 2019 16:30 — forked from pmarquees/editPage.js
Edit page (bookmarlet)
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0
@kevinold
kevinold / postgres_queries_and_commands.sql
Created May 15, 2019 20:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@kevinold
kevinold / restart_bluetooth.sh
Created May 1, 2019 17:01 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@kevinold
kevinold / Immutable JS Examples
Created January 4, 2019 21:05 — forked from singhshivam/Immutable JS Examples
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@kevinold
kevinold / MyCoolComponent.js
Created November 15, 2018 02:44 — forked from KittyGiraudel/MyCoolComponent.js
A simple textarea + counter component, fully commented for React beginners. :)
import React from 'react';
import MyCoolTextarea from '../MyCoolTextarea';
import MyCoolCounter from '../MyCoolCounter';
const MyCoolComponent = React.createClass({
// Define a method on the parent component describing what should happen when
// the textarea gets updated. At this point, the only thing needed is to store
// the length of the textarea’s content in a state on the parent component.
//
var completed = 30;
var target = 30;
var progress = Math.ceil(completed / target * 100);
console.log(progress);

Nodecopter

Overview

In this workshop you'll learn about the wonderful world of autonomous flying robots, specifically the AR Drone 2.0 provides a high level API to send commands, read data back and stream video from it's HD camera.

We'll start writing basic programs to take off and land, and before you know it you'll be using feedback from a wealth of onboard sensors to perform more impressive maneuvers and behaviours.

Preparations

@kevinold
kevinold / upload-github-release-asset.sh
Created April 5, 2018 22:06 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner