Skip to content

Instantly share code, notes, and snippets.

@brookemckim
brookemckim / postgres_queries_and_commands.sql
Last active April 10, 2024 20:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
ORDER BY query_start desc;
-- REINDEX Status
SELECT
now()::TIME(0),
a.query,
@brookemckim
brookemckim / hls
Created June 8, 2011 19:05
Roku Recommended FFMPEG h264 Preset
ffmpeg -i <inputFile> -f mpegts -acodec libfaac -vcodec libx264 \ -vpre roku -crf 15 -threads 0 ~/OneTransportStreamFile3200.ts
@brookemckim
brookemckim / chef_error.txt
Created May 12, 2011 20:48
Chef::Exceptions::PrivateKeyMissing
[Thu, 12 May 2011 16:46:45 -0400] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/client.pem>
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Running exception handlers
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Exception handlers complete
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Stacktrace dumped to /tmp/chef-stacktrace.out
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
const moment = require('moment');
const turf = require('@turf/turf');
const UUID = require("pure-uuid");
const K_ANON_VAL = 4;
const FUZZED_TIME_BUCKET = 15;
const FUZZED_LOCATION_PRECISION = 3;
const RANDOM_LATITUDE_RADIUS = 0.004;
const RANDOM_LONGITUDE_RADIUS = 0.005;
osascript -e 'tell application "iTunes" to activate' -e 'tell application "System Events"' -e 'tell application process "iTunes"' -e 'click menu item "Update iTunes Match" of menu 1 of menu bar item "Store" of menu bar 1' -e 'end tell' -e 'end tell'
$(document).scroll(function() {
$(".sticky").offset(function() {
var documentHeight = $(document).height();
console.log(documentHeight);
$this = $(this);
var scrollTop = $(window).scrollTop();
var offsetTop = $this.data("offset-top");
if (scrollTop < 0) {
scrollTop = 0;
// Generated by CoffeeScript 1.3.3
$(document).ready(function() {
$(".playlist").addClass("closed hidden transition transition-height");
return $(".cover-picker").on("click", "a", function(event) {
var albumSelected, canvas, coverActive, coverAnchor, coverSelected, image, indicatorPosition, playlistHeight, switchPlaylistToAlbum, togglePlaylistForAlbum,
_this = this;
coverAnchor = this;
coverSelected = coverAnchor.parentNode;
coverActive = $(".cover-picker .active");
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
def test_past_recording_is_associated_with_stream
stream = Stream.create(...)
recording = PastRecording.from_stream(stream)
assert_equal recording.stream, stream
end
/* Heartbeat */
/*
>> Pulse Sensor Amped 1.1 <<
This code is for Pulse Sensor Amped by Joel Murphy and Yury Gitman
www.pulsesensor.com
>>> Pulse Sensor purple wire goes to Analog Pin 0 <<<
Pulse Sensor sample aquisition and processing happens in the background via Timer 2 interrupt. 2mS sample rate.
PWM on pins 3 and 11 will not work when using this code, because we are using Timer 2!
The following variables are automatically updated:
Signal : int that holds the analog signal data straight from the sensor. updated every 2mS.