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
| import type { Context, Config } from "@netlify/edge-functions"; | |
| /** | |
| * Content negotiation edge function that serves Markdown versions of pages | |
| * when the Accept header prefers text/plain or text/markdown over text/html | |
| */ | |
| export default async (req: Request, context: Context) => { | |
| const url = new URL(req.url); | |
| const pathname = url.pathname; | |
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
| <!-- ID: 881 --> | |
| <div class="container-fluid sticky-top"> | |
| <div class="row"> | |
| <a href="javascript:void(0)" class="btn btn-live-schedule-trigger hidden-xs" data-smooth-scroll-to="live-stream-schedule" | |
| data-smooth-scroll-offset="92" data-track-click="liveSeeScheduleClicked"> | |
| <span>See Schedule</span> | |
| <svg class="icon icon-1" viewbox="0 0 256 256"> | |
| <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/svgs/icons.svg#chevron-down"></use> | |
| </svg> |
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
| require 'fileutils' | |
| path = File.expand_path('../', __FILE__) | |
| Dir.glob("#{path}/**/*.*").each do |file| | |
| new_path = "#{path}/#{file.split('/')[-1]}" | |
| FileUtils.mv(file, new_path) | |
| 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
| module Utils::All | |
| # I wrote this originally for model concerns, in which case I needed | |
| # the following line to be included: | |
| # extend ActiveSupport::Concern | |
| Dir.glob(File.expand_path('../', __FILE__) + '/*.rb').each do |util| | |
| next if File.basename(util) == 'base.rb' | |
| include "Utils::#{File.basename(util, '.rb').camelize}".constantize | |
| end | |
| 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Multiple CSS Imports</title> | |
| <link rel="stylesheet" href="styles-01.css" /> | |
| <link rel="stylesheet" href="styles-02.css" /> |
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
| <style> | |
| .bg-video { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100vw; | |
| height: 100vh; | |
| overflow: hidden; | |
| z-index: -1; | |
| } |
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
| # Assumes: | |
| # - curl is installed | |
| # - you have a slack channel with an incoming webhook configured | |
| require 'json' | |
| def notify_slack(webhook_url, channel, username, text, image) | |
| payload = { | |
| :channel => channel, | |
| :username => username, |
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
| require 'open-uri' | |
| def download_image(url, dest) | |
| open(url) do |u| | |
| File.open(dest, 'wb') { |f| f.write(u.read) } | |
| end | |
| end | |
| urls = [ | |
| 'http://petsfans.com/wp-content/uploads/2014/11/edfsaf.jpg', |
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
| require 'csv' | |
| desc 'Import local files (with csv references) using Dragonfly' | |
| task :dragonfly_import => :environment do | |
| config = [ | |
| {:model => Attachment, :attr => :document} | |
| ] | |
| storage_dir = "#{Rails.root}/lib/cw_refs" |
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
| #!/usr/bin/env ruby | |
| # Include libraries | |
| # | |
| require 'fileutils' | |
| # Make sure we have our argument | |
| # | |
| if ARGV.size < 1 | |
| puts "Usage: project [DIR]" |
NewerOlder