Skip to content

Instantly share code, notes, and snippets.

View tinacious's full-sized avatar
👩‍💻

Tina Holly tinacious

👩‍💻
View GitHub Profile
@tinacious
tinacious / plugin-styles.css
Created July 6, 2019 19:22
plugin-styles.css
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; }
audio, canvas, video { display: inline-block; }
audio:not([controls]) { display: none; height: 0; }
[hidden], template { display: none; }
html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
@tinacious
tinacious / well.ca-price-per-unit-bookmarklet.js
Created June 9, 2019 21:35
Bookmarklet for Well.ca to display price per unit of measurement
/**
* Show price per quantity
* If the price per unit is greater than the average, it displays in red.
* Example: https://i.imgur.com/dvu0o4c.png
* Usage:
* 1. Copy the code
* 2. In an existing bookmark in Chrome, type `javascript:` (omit the surrounding ticks)
* 3. Paste the contents of this code after `javascript:`
*/
(() => {
@tinacious
tinacious / version_bump.js
Created January 9, 2019 03:26
Version bump Node.js projects
/**
* 1. Download file and put somewhere
*
* 2. In your ~/.bash_profile:
*
* alias version="node /path/to/version_bump.js"
*
* 3. From a JS project:
*
* version <type> major (M) | minor (m) | patch (p)
@tinacious
tinacious / ig-download.js
Last active July 8, 2018 20:37
📸 IG Download bookmarklet
/**
* When on Instagram web, after clicking the image, a modal pops up.
* Running this when the modal is open will work to grab the photo,
* which will be the last photo in the DOM.
* If you get to an IG photo page and the modal is not open, this won't work.
* To use as a bookmarklet, copy this code, create a new bookmark, & paste it after:
* javascript:
*/
(function () {
const images = document.querySelectorAll('img');
@tinacious
tinacious / tota11y bookmarklet.js
Created March 16, 2017 00:18
Add tota11y accessibility tool to the page
/**
* Adds accessibility tool tota11y to the page
*/
(function () {
var totally = document.createElement('script');
totally.src = 'https://cdn.rawgit.com/Khan/tota11y/0.1.3/build/tota11y.min.js';
document.head.appendChild(totally);
})();
@tinacious
tinacious / Too Big bookmarklet.js
Last active March 8, 2017 18:56
Prompts the user for a width value in pixels and then finds all DOM elements greater than the provided width
/**
* Prompts the user for a width value in pixels and then
* finds all DOM elements greater than the provided width
*/
(function () {
const desiredWidth = Number(prompt('Wider than what? (px)'));
document.body.querySelectorAll('*')
.forEach((item) => {
var width = item.offsetWidth;
/**
* Show background colours and borders for all elements
*/
(function () {
const Outline = {
id: 'td-outline-toggle',
getStyleElement: () => {
const styleElement = document.createElement('style');
styleElement.id = Outline.id;
/**
* Show bootstrap grid
*/
(function () {
const Grid = {
id: 'td-bootstrap-grid-toggle',
show: () => {
const containerWrapperElement = document.createElement('div');
@tinacious
tinacious / app.js
Created July 17, 2014 13:15
Using Express to serve a static site on Node.js for easy deploy to Heroku
/**
* This is your Node app's main file
* Don't forget to run `heroku ps:scale web=1` in the Terminal
*/
var express = require('express');
var http = require('http');
var path = require('path');
var app = express();
app.set('port', process.env.PORT || 3000);
@tinacious
tinacious / images.sh
Last active August 29, 2015 13:55
This bash script batch resizes and renames images. Run this script in a directory with images to process them. It will ask you: current file extension, and desired filename and size.
# Image processing function
# Usage: In the Terminal, run: bash images.sh
# Get user input and resize images
function process () {
# rename
a=1
for i in *.${ext}
do