Skip to content

Instantly share code, notes, and snippets.

@sirupsen
sirupsen / sidenotes.tsx
Last active June 11, 2024 07:02
Sidenotes and table of contents on MDX with React.
function isColliding(a: DOMRect, b: DOMRect) {
return !(
((a.y + a.height) < (b.y))
|| (a.y > (b.y + b.height))
|| ((a.x + a.width) < b.x)
|| (a.x > (b.x + b.width))
);
}
// Move the footnotes from the bottom to become sidenotes if the viewport is
@tomhicks
tomhicks / plink-plonk.js
Last active July 22, 2024 09:51
Listen to your web pages
@thefranke
thefranke / RSS.md
Last active July 18, 2024 22:29
A list of RSS endpoints, readers and resources

The RSS Endpoint List

Please refer to this blogpost to get an overview.

Replace *-INSTANCE with one of the public instances listed in the scrapers section. Replace CAPITALIZED words with their corresponding identifiers on the website.

Social Media

Twitter

@LukeTowers
LukeTowers / .0 - cheatsheet.sh
Last active February 6, 2023 20:58
Introduction to OctoberCMS
# Setup symlinks in local development copy of Winter to the local development copy of Winter.Workshop
ln -s ~/LocalRepositories/WinterCMS/Themes/Winter/Workshop ~/LocalRepositories/WinterCMS/Core/winter/themes/workshop
# Setup external symlink (for mac, outside of vagrant) to the local development copies of my plugins
ln -s ~/Repositories/WinterCMS/Themes/Winter/Workshop ~/Repositories/WinterCMS/Core/winter/themes/workshop-src
# Setup symlinks in local development copy of Winter to the local development copies of my plugins
ln -s ~/LocalRepositories/WinterCMS/Plugins ~/LocalRepositories/WinterCMS/Core/winter/plugins
# Setup external symlink (for mac, outside of vagrant) to the local development copies of my plugins
<?php
// This was a quick proof of concept from 2009, use the script freely - https://www.realisingdesigns.com/web-design-articles/using-google-docs-quick-easy-cms/
// Specify document
$gd_doc = "dd9zpc9r_4jh8qv76j";
$gd_doc_type = "doc";
$gd_array = array();
$gd_array["doc"]["url"] = "http://docs.google.com/View?id=".$gd_doc;
$gd_array["doc"]["start"] = '&lt;div id="doc-contents"&gt;';
@claus
claus / ipfs-server-setup.md
Last active May 9, 2023 03:51
Host Your Site Under Your Domain on IPFS

Host Your Site Under Your Domain on IPFS

This is a step-by-step tutorial for hosting your website under your domain on IPFS, from zero, on a DigitalOcean Ubuntu 16.04.3 x64 Droplet (i am using the $10 variant with 2GB RAM).

Install IPFS

Log in as root.

First, make sure the system is up to date, and install tar and wget:

@CannonballSkippy
CannonballSkippy / test.html
Created May 17, 2017 21:33
Basic markup test content for typography
<h1>Testing display of HTML elements</h1>
<h2>This is 2nd level heading</h2>
<p>This is a test paragraph.</p>
<h3>This is 3rd level heading</h3>
<p>This is a test paragraph.</p>
<h4>This is 4th level heading</h4>
<p>This is a test paragraph.</p>
<h5>This is 5th level heading</h5>
<p>This is a test paragraph.</p>
@jaclyntan
jaclyntan / wp-autobsrows
Created February 1, 2017 03:11
Automatic bootstrap rows in the WordPress loop
<?php
$counter = 0;
while ( have_posts() ) : the_post();
$counter++;
if ($counter === 1) {
echo '<div class="row">';//start the row
}
echo '<div class="col-sm-__NAME__">';//start the col//
get_template_part( 'template-parts/content', 'page' );
@m-e-h
m-e-h / Responsive-embed.css
Last active April 22, 2018 14:14
Responsive video embeds for WP
/**
* Flexible media embeds
*
* For use with media embeds – such as videos, slideshows, or even images –
* that need to retain a specific aspect ratio but adapt to the width of their
* containing element.
*
* Based on: http://alistapart.com/article/creating-intrinsic-ratios-for-video
*/
@acidtib
acidtib / remote-file-exists.php
Created July 27, 2016 19:57 — forked from vyspiansky/remote-file-exists.php
PHP: file_exists for remote URL
<?php
// Source: http://goo.gl/aZ1h8v
$file_headers = @get_headers($url);
if ($file_headers[0] == 'HTTP/1.0 404 Not Found'){
$file_exists = false;
} else {
$file_exists = true;
}
?>