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,
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.
(function() {
var Drop = window.Drop = function() {
var files = [];
var add = function(word) {
files.push(word);
return files;
}
#! /usr/bin/env ruby
folder = '/Users/bmckim/Desktop/pushConfigFiles'
applications = Dir.glob(folder + '/*')
applications.each do |app|
application_name = app.split('/').last
new_config = app + '/PushPublishMap.txt'
new_config_lines = []