Skip to content

Instantly share code, notes, and snippets.

@ttscoff
ttscoff / a_lazy_youtube_tag.rb
Last active January 26, 2020 17:57
My current setup for embedding YouTube videos in Jekyll. Responsive layout, poster image first/click to load for faster page loads.Provides a `{% youtube VIDEOID 800 600 "optional caption" %}` tag that generates the markup needed for the CSS and jQuery script.
# Title: Responsive Lazy Load YouTube embed tag for Jekyll
# Author: Brett Terpstra <http://brettterpstra.com>
# Description: Output a styled element for onClick replacement with responsive layout
#
# Syntax {% youtube video_id [width height] ["Caption"] %}
#
# Example:
# {% youtube B4g4zTF5lDo 480 360 %}
# {% youtube http://youtu.be/2NI27q3xNyI %}
@ttscoff
ttscoff / Dropzone Image Filer.dropzone.rb
Last active March 22, 2020 10:31
Dropzone Destination for filing images to a Jekyll uploads folder and returning Markdown links to relative paths
#!/usr/bin/ruby
# Dropzone Destination Info
# Name: Jekyll Image Filer
# Description: Files images in a Jekyll repo
# Handles: NSFilenamesPboardType
# Creator: Brett Terpstra
# URL: http://brettterpstra.com
# IconURL: http://brettterpstra.com/destinations/icons/jekyllfiler.png
# OptionsNIB: ChooseFolder
@brettkelly
brettkelly / nvAltNoteFromSelection.applescript
Created April 18, 2013 18:02
AppleScript to create a new nvAlt note from the selected text in any app.
-- copy selected text
tell application "System Events"
keystroke "c" using command down
end tell
-- switch to nvAlt
tell application "nvALT"
activate
tell application "System Events"
keystroke "l" using command down -- Create or Search