This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT schemaname, relname, n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Debugging helper, useful while fixing N+1 problems | |
# Based on https://gist.github.com/crazymykl/b526e0ed6b285b3c4e77 | |
def count_queries(log: false, &block) | |
ActiveRecord::Base.logger = Logger.new(STDOUT) if log | |
query_count = 0 | |
increment_count = -> (*) { query_count += 1 } | |
ActiveSupport::Notifications.subscribed(increment_count, 'sql.active_record', &block) | |
query_count | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop do | |
print 'Listening... ' | |
utterance = gets | |
command = utterance.strip.sub(/\.$/, '').downcase.split(/\s+/).first | |
case command | |
when 'say' | |
puts utterance.sub(/^say/i, '') | |
when 'exit', 'quit' | |
puts "Exiting..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void(prompt('Copy',"<item><title>"+document.title+'</title><guid%20isPermaLink="true">'+document.location+"</guid><link>"+document.location+"</link></item>")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Vue.js Sandbox</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/vue/dist/vue.js"></script> | |
<div id="app"> | |
<button @click="checkAll">Check all</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @match https://www.google.com/calendar/* | |
// ==/UserScript== | |
window.alert = function (s) { | |
console.log(s); | |
}; | |
console.log('Disabling Google Calendar javascript alerts. They are instead routed to this console.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not a pretty sight | |
When the web dies screaming loud | |
The site is not found. | |
Morning and sorrow | |
404 not with us now | |
Lost to paradise. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gist_urls_file=$(mktemp) | |
gist -l | sed 's/ .*$//' > $gist_urls_file | |
cat $gist_urls_file | while read -r line; do | |
gist_url="$line" | |
gist_id="$(echo $gist_url | sed 's|https://gist.github.com/||')" | |
clone_url="[email protected]:$gist_id.git" | |
git clone $clone_url | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0"> | |
<channel> | |
<title>Asimov - Foundation Trilogy</title> | |
<description>Isaac Asimov's Foundation Trilogy in BBC Audio from the Internet Archive</description> | |
<item> | |
<title>Part 1 of 8</title> | |
<enclosure url="http://www.archive.org/download/IsaacAsimov-TheFoundationTrilogy/IsaacAsimov-Foundation1Of8_64kb.mp3" type="audio/mpeg"/> | |
</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Push to Talk | |
// @namespace http://tampermonkey.net/ | |
// @version 0.5 | |
// @description Hold down the spacebar to unmute the mic in Google Meet; tapping the spacebar toggles mute. | |
// @author Marc Reynolds (github.com/marcreynolds) | |
// @match https://meet.google.com/* | |
// @updateUrl https://gist.github.com/marcreynolds/6c629eaf8bfe87986ebe90ebea7daf85/raw/google-meet-spacebar.user.js | |
// @grant none | |
// ==/UserScript== |