Skip to content

Instantly share code, notes, and snippets.

@rviscomi
rviscomi / CrashCourseInCrUX.md
Last active May 7, 2019 10:52
"Crash Course in CrUX" for the PerfMatters conference, April 2019
@trevanhetzel
trevanhetzel / table-sorting.js
Created June 14, 2017 03:21
Simple table sorting for dates, strings & integers w/ jQuery & ES6
/**
* Custom table sorting
*/
import $ from 'jquery';
export default {
// Set this opposite to what the default ordering is
DESC: false,
@jmhobbs
jmhobbs / README.md
Last active March 24, 2023 15:19
Create scrolling text gifs for Slack

Makes little scrolly text jiffs in Flywheel colors.

Prerequisites

  • imagemagick brew install imagemagick
  • gifsicle brew install gifsicle
  • Heartwell 1.2.otf font installed
  • u r on a mac

Usage

@splitinfinities
splitinfinities / Add jQuery
Created January 3, 2017 15:58
Add jQuery (chrome bookmark)
javascript:var script = document.createElement("script"); script.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"; script.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(script);

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@sumeetjain
sumeetjain / digital_ocean_excellent_support.md
Last active June 17, 2016 04:22
After sharing the chat history of my support request at Digital Ocean on Twitter, two of their team members got in touch to set things right.

After making this tweet yesterday, Digital Ocean got in touch with me to explain what might have gone wrong. Two members responded: Zach Bouzan-Kaloustian and Tyler Crandall. Both of them sent thoughtful and thorough replies and apologized for the poor experience I'd had up to that point.

When I posted to Twitter yesterday, my goal was to learn what I had done wrong so I could properly teach students how to use Digital Ocean in the future. Turns out there was just a bug in their system related to some code that had just been deployed, and it raised abuse flags for users who signed up during a short window. They've, of course, fixed the bug and are going to make improvements to their support procedures to hopefully avoid situations like mine from yesterday.

Zach's email to me is pasted below, for the curious. But before you get to that, let me very clear: **Bugs happen. That includes behavioral bugs, like momentary lapses in support quality. Fro

@youngbrioche
youngbrioche / images_helper.rb
Last active February 8, 2024 08:15
Responsive images helper using srcset in Rails
module ImagesHelper
# Acts as a thin wrapper for image_tag and generates an srcset attribute for regular image tags
# for usage with responsive images polyfills like picturefill.js, supports asset pipeline path helpers.
#
# image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image'
#
# => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image">
#
def image_set_tag(source, srcset = {}, options = {})
srcset = srcset.map { |src, size| "#{path_to_image(src)} #{size}" }.join(', ')
@trevanhetzel
trevanhetzel / fb-album-fetcher.js
Last active July 30, 2022 03:09
Facebook Album Fetcher
/* Descripton: A basic plugin to fetch all albums and associated photos from a Facebook page
* Usage: Simply reference the script and instantiate it
* Example instantiaion:
$(window).load(function () {
albumFetcher({
fbId: "137248356344058",
container: ".photos"
});
@hijonathan
hijonathan / form.html
Last active August 1, 2023 19:14
Submit a HubSpot form with AJAX without redirecting the user.
<form class='form-inline' id='my-custom-form'>
<div class="form-group">
<input type='email' class='form-control' placeholder='Your email address' required>
</div>
<button class="btn btn-primary" type='submit'>Sign up</button>
</form>
<!-- Actual form that gets submitted to HubSpot -->
<div class="hidden" id='hubspot-form'>
<script charset="utf-8" src="//js.hsforms.net/forms/current.js"></script>
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: