This file contains 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
#!/bin/bash | |
# Creates a spritesheet of all png and svg images in the current folder in | |
# 16, 24, 32 and 64px on light, mid-grey and dark backgrounds. | |
# | |
# Requirements: Inkscape, Imagemagick, optipng | |
# | |
# Arguments: ["dev"] Optional, if present, will export and then get all the | |
# exported sheets and combine them in a global sheet. | |
# If absent, will simply export to pngs and create a light, dark and mid-grey spritesheet |
This file contains 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
#!/bin/bash | |
input=${1:-64} | |
#Creates output directory if it doesn't exist and empties it. | |
mkdir ~/Pictures/exportOutput | |
rm ~/Pictures/exportOutput/*.png | |
for file in *.svg | |
do |
This file contains 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
#!/bin/bash | |
for file in *.svg | |
do | |
height=$(/usr/bin/inkscape -H $file) | |
width=$(/usr/bin/inkscape -W $file) | |
#Generally the icons have a bit of margin around them, so tune this value appropriately | |
if [[ $height < 55 ]] && [[ $width < 55 ]]; then | |
echo $file" : "$height" x "$width | |
fi |
This file contains 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
#!/bin/bash | |
# Loops through all svg files in a directory | |
# Fields with an existing value are left alone | |
# Empty fields are filled with sensible defaults | |
# Licensing or Rights information is flagged for manual review | |
for file in *.svg | |
do | |
me="[agryson] Alexander Gryson" |
This file contains 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
/** | |
* Attribution: Alexander Gryson (agryson.net) | |
* This script stores a listing of the files in a folder. | |
* If a new item is placed in the folder, an email will be sent. | |
* LIMITATION: This script can only handle about 70 listings due to the 9kb limit for properties. | |
* If the number of listings goes above 50, a warning will be sent. | |
*/ | |
function listFilesInFolder() { | |
var folderID = '1234567890AZERTYUIOPQSDFGHJKLM_EXAMPLE'; //ID of the folder to watch | |
var admin = 'admin_example@gmail.com'; //Email of the person to notify |
This file contains 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
/** | |
* Attribution: Alexander Gryson (agryson.net) | |
* Appends or removes a class to/from an element | |
* @param {boolean} bool True if appending class, false if removing | |
* @param {string} targetID ID of target element | |
* @param {string} classString Class to be added / removed (case sensitive) | |
*/ | |
function classChange(bool, targetID, classString){ | |
var target = document.getElementById(targetID); |