Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile
@jedfoster
jedfoster / .gitignore
Last active February 28, 2025 14:33
JavaScript version of Sass' mix() function
package-lock.json
@jedfoster
jedfoster / Search request
Created October 21, 2024 21:58
Feedbin feed search request/response
POST /feeds/search HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript
Sec-Fetch-Site: same-origin
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br
Sec-Fetch-Mode: cors
Host: feedbin.com
Origin: https://feedbin.com
Content-Length: 173
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>The Seattle Times Food &amp; Drink – The Seattle Times</title>
<atom:link href="https://www.seattletimes.com/food-drink/feed/" rel="self" type="application/rss+xml"/>
<link>https://www.seattletimes.com</link>
<description>The Food &amp; Drink section brings you news about the Seattle restaurant and bar scene such as openings, closings, news about chefs and advice on where to go for a great meal or happy hour. </description>
<lastBuildDate>Mon, 21 Oct 2024 13:39:59 -0700</lastBuildDate>
<language>en-US</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
@jedfoster
jedfoster / Markdown test.md
Last active August 23, 2024 17:32
Markdown test <b>BOLD</b>

H1: Roughdraft is GitHub Gists, made pretty. #7a7a7a

H2: Roughdraft is GitHub Gists, made pretty. #7a7a7a

H3: Roughdraft is GitHub Gists, made pretty. #7a7a7a

H4: Roughdraft is GitHub Gists, made pretty. #646464

H5: Roughdraft is GitHub Gists, made pretty. #4d4d4d
H6: Roughdraft is GitHub Gists, made pretty. #212121

Alternatively, for H1 and H2, an underline-ish style:

Alt-H1

@jedfoster
jedfoster / input.scss
Created January 4, 2024 17:41
Generated by SassMeister.com.
$red: #f00;
.box {
color: $red;
}
@jedfoster
jedfoster / input.scss
Created August 1, 2023 14:32
Generated by SassMeister.com.
//@use 'core/mixins';
//@use 'variables' as *;
$_breakpoints: (
'tablet': 650px,
'desktop': 992px,
'hd': 1280px,
) !default;
@mixin breakpoint($break) {
@jedfoster
jedfoster / input.scss
Created April 5, 2022 15:33
Generated by SassMeister.com.
$size-spacing-xs: 0.5rem;
.overviewLink:hover {
text-decoration: none;
.avatar {
outline-width: ($size-spacing-xs / 2);
outline-width: calc(#{$size-spacing-xs} / 2);
}
}
@jedfoster
jedfoster / input.scss
Created April 5, 2022 15:32
Generated by SassMeister.com.
$size-spacing-xs: 2rem;
.overviewLink:hover {
text-decoration: none;
.avatar {
outline-width: ($size-spacing-xs / 2);
outline-width: calc(#{$size-spacing-xs} / 2);
}
}
import * as path from 'path';
import adapter from '@sveltejs/adapter-auto';
import { markdown } from 'svelte-preprocess-markdown';
const API_BASE = process.env.DEV ? 'http://127.0.0.1:3000' : 'https://api.svelte.dev';
const config = {
kit: {
adapter: adapter(),
vite: () => ({
@jedfoster
jedfoster / javascript.js
Created October 12, 2012 19:47
Textarea selection and caret manipulation with Javascript
HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea
return this.selectionStart;
};
HTMLTextAreaElement.prototype.setCaretPosition = function (position) { //change the caret position of the textarea
this.selectionStart = position;
this.selectionEnd = position;
this.focus();
};
HTMLTextAreaElement.prototype.hasSelection = function () { //if the textarea has selection then return true
if (this.selectionStart == this.selectionEnd) {