Skip to content

Instantly share code, notes, and snippets.

// via: https://dev.to/kushalst/discord-notifications-on-google-form-submission-1837
var POST_URL = "discord-webhook-url";
function onSubmit(event) {
var discordPayload = {
content: "Form Submission",
embeds: [
{
type: "rich",
@mckelvey
mckelvey / GIF-Screencast-OSX.md
Created November 21, 2019 20:54 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

(function(window) {
var data = [
{
id: 71,
title: "FLIR City",
background: {
imageFilename: 'static-city.png',
overlayFilename: 'static-city-overlay.png',
videoFilename: 'active-city.mp4',
},
@mckelvey
mckelvey / postgres_queries_and_commands.sql
Created August 22, 2019 19:38 — 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%'
@mckelvey
mckelvey / permissions-fix.sh
Created August 15, 2019 18:04
SiteGround Permissions Fix
find . -type d -print0 | xargs -0 chmod 0755 && find . -type f -print0 | xargs -0 chmod 0644
@mckelvey
mckelvey / timelapse.md
Created July 10, 2019 19:35 — forked from billmei/timelapse.md
ffmpeg time-lapse

Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video

ffmpeg \
  -r 30000/1001 \
  -pattern_type glob -i '*.JPG' \
  -vf "crop=in_w:in_w*9/16,scale=3840:-2" \
  -sws_flags lanczos \
  -pix_fmt yuv420p \
 -vcodec libx264 \
@mckelvey
mckelvey / wget.sh
Last active August 6, 2022 14:45 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
wget --recursive --no-clobber --page-requisites --adjust-extension --span-hosts --convert-links --no-parent --no-check-certificate -erobots=off --domains yoursite.com yoursite.com/whatever/path
/* replaces lines 18985-19057 of HTMLPurifier.standalone.php v.4.9.3 */
/**
* @param DOMNode $node
*/
protected function getTagName($node)
{
if (property_exists($node, 'tagName')) {
return $node->tagName;
} else if (property_exists($node, 'nodeName')) {

Keybase proof

I hereby claim:

  • I am mckelvey on github.
  • I am mckelvey (https://keybase.io/mckelvey) on keybase.
  • I have a public key whose fingerprint is 6C10 B568 D534 3F3A EF3B C6E1 02CF 9F99 0275 F076

To claim this, I am signing this object:

@mckelvey
mckelvey / gist:657a5c86b4429ac951d8
Created July 7, 2015 20:29
How to collect all Material Design SVGs into a single folder...
# Inside the repo root
$ mkdir svg-collected
$ find . -type f -iname '*_48px.svg' -exec cp {} ~/Desktop/material-design-icons-2.0/svg-collected/ \;
# Rename the Filenames
$ for i in *_48px.svg; do mv -- "$i" "${i/_48px/}"; done
$ for i in ic_*; do mv -- "$i" "${i/ic_/}"; done
$ for i in *_*; do mv -- "$i" "${i/_/ }"; done