Skip to content

Instantly share code, notes, and snippets.

@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
@kevinold
kevinold / buildspec.yml
Created November 17, 2017 18:23 — forked from marcelog/buildspec.yml
Example for buildspec file for Amazon CodeBuild and Amazon CodePipeline to achieve Continuous Integration and Continuous Delivery for a ServerLess project
version: 0.1
phases:
install:
commands:
- printenv
- npm install
build:
commands:
- npm run build
@kevinold
kevinold / destructuring.js
Created October 16, 2017 19:56 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
'use strict';
var blacklist = require('./node_modules/react-native/packager/blacklist');
var path = require('path');
/**
* Default configuration for the CLI.
*
* If you need to override any of this functions do so by defining the file