Skip to content

Instantly share code, notes, and snippets.

@whatsim
whatsim / README.md
Last active May 17, 2021 19:20
Remove Color Cast on Negatives

Takes an input Tiff of a color negative, and subtracts the film backing color contamination per http://www.dpreview.com/forums/post/499854

Requires Image Magick with libtiff. Easy way to get that on OSX is with homebrew. Just run

brew install --with-libtiff imagemagick

with brew installed. Then you use the script like

./remove_color_cast filename.tif
@dudleystorey
dudleystorey / batch-resize.jsx
Created February 24, 2015 06:49
Creates smaller square thumbnail images with correct appended file names, given a folder of original JPEG, PNG and GIF files at large sizes
// explanatory article: https://demosthenes.info/blog/993/1x-2x-3x-more-Batch-Processing-Retina-Images-with-PhotoShop-and-JavaScript
var inputFolder = Folder.selectDialog("Select a folder to process"),
outputFolder = Folder.selectDialog("Select a folder for the output files"),
imageSizes = [
["250px", "250px", "1x"],
["125px", "125px", "icon-2x"],
["75px", "75px", "icon-1x"]
],
numImageSizes = imageSizes.length;
@colintoh
colintoh / table.css
Created October 27, 2014 05:42
Table CSS
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
@dalgard
dalgard / matchesSelector.js
Last active February 20, 2018 22:47
Cross-browser wrapper for element.matchesSelector
function matchesSelector(dom_element, selector) {
var matchesSelector = dom_element.matches || dom_element.matchesSelector || dom_element.webkitMatchesSelector || dom_element.mozMatchesSelector || dom_element.msM atchesSelector || dom_element.oMatchesSelector;
return matchesSelector.call(dom_element, selector);
}
@rxin
rxin / ramdisk.sh
Last active December 13, 2023 02:40
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@brysongilbert
brysongilbert / css-shadow-mixin.less
Created October 15, 2012 01:48
LESS Mixin for CSS/SVG Filter Drop Shadows
// Drop shadow using SVG/CSS filters were possible
// Requires Modernizr and the css-filters and svg-filters community add-ons
.filter-shadow(@x, @y, @size, @color) {
// Firefox 10+
.svgfilters & {
@svgSize: @size/2; // the SVG blur is a little larger than the CSS equivalent
filter: url('data:image/svg+xml;utf8,<svg%20height="100"%20xmlns="http://www.w3.org/2000/svg"><filter%20id="drop-shadow"><feGaussianBlur%20in="SourceAlpha"%20stdDeviation="@{svgSize}"/><feOffset%20dx="@{x}"%20dy="@{y}"%20result="offsetblur"/><feFlood%20flood-color="@{color}"/><feComposite%20in2="offsetblur"%20operator="in"/><feMerge><feMergeNode/><feMergeNode%20in="SourceGraphic"/></feMerge></filter></svg>#drop-shadow');
}
// Chrome 19+, Safari 6+