Skip to content

Instantly share code, notes, and snippets.

View tinacious's full-sized avatar
👩‍💻

Tina Holly tinacious

👩‍💻
View GitHub Profile
@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
@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 / 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;
@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 / 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 / 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 / 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%; }
{
"env": {
"node": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
/**
* Show bootstrap grid
*/
(function () {
const Grid = {
id: 'td-bootstrap-grid-toggle',
show: () => {
const containerWrapperElement = document.createElement('div');
@tinacious
tinacious / install_vscode_extensions.sh
Created December 17, 2020 02:07
A list of my installed Visual Studio Code extensions
code --install-extension aeschli.vscode-css-formatter
code --install-extension annsk.alignment
code --install-extension bierner.markdown-preview-github-styles
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension dbaeumer.vscode-eslint
code --install-extension EditorConfig.EditorConfig
code --install-extension eg2.vscode-npm-script
code --install-extension fcrespo82.markdown-table-formatter
code --install-extension HookyQR.beautify