This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show bootstrap grid | |
*/ | |
(function () { | |
const Grid = { | |
id: 'td-bootstrap-grid-toggle', | |
show: () => { | |
const containerWrapperElement = document.createElement('div'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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:` | |
*/ | |
(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! 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%; } |
OlderNewer