Skip to content

Instantly share code, notes, and snippets.

View hparra's full-sized avatar

H. G. Parra hparra

View GitHub Profile
@hparra
hparra / fulcrum.console.md
Last active August 25, 2023 19:29
fulcrum.console Conversion Notes

fulcrum.console Conversion Notes

When possible we try to group changes.

Root

dotfiles

Add predefs to .jshintrc

@hparra
hparra / ImageMagickWebTips.md
Last active December 24, 2015 22:49
Tips for producing web images with ImageMagick

Resize

convert -resize 75% <2x source> <1.5x destination>
convert -resize 50% <2x source> <1x destination>

Add Padding

@hparra
hparra / RenamingSeveralFilesUsingSed.md
Last active December 24, 2015 15:28
Renaming several files using sed (Unix)

(I keep forgetting how to do this!)

* returns all files in a directory. It can also be used as a general wildcard:

  • *.jpg will return only JPG filenames
  • something* will return only filenames that start with something
for f in *; do mv $f $(echo $f | sed SED_SCRIPT); done
@hparra
hparra / microMediaQueries.md
Last active December 24, 2015 11:19
Micro Media Queries: a shorten CSS media queries format

Micro Media Queries

Micro Media Queries (MMQs) provide a way to specify CSS media queries in a short format. They use descriptors specified in the srcset attribute with a grammar inspired by @media rules.

The idea of MMQs came about when attempting to consolidate the various methods for producing responsive images: @media, <img srcset>, image-set, and <picture>. A goal is to have 1-1 correspondence so that it easy to convert a query between any of these formats.

Since MMQs tend to be very short, they may be particulary helpful as folder names, within a filename, or as a snippet.

Examples for Use

@hparra
hparra / OnResponsiveAdaptiveImage.md
Last active December 24, 2015 08:59
On Responsive and Adaptive Images

On Responsive and Adaptive Images

There is quite a bit going on in both the HTML and CSS specifications regarding responsive and/or adaptive images. It can get a little overwhelming.

Specifications

Authorities

@hparra
hparra / pathNomenclature.md
Last active December 24, 2015 06:29
Path Nomenclature a la Node

Path Nomenclature a la Node

The following is path nomenclature inferred by the node.js library:

  • path: /path/to/your/file.txt
  • dirname: /path/to/your/
  • basename: file.txt
  • extname txt

When writing code for node, it is preferable to use these terms for variables, etc.

@hparra
hparra / StopCallingItAMediaQuery.md
Last active December 22, 2015 23:19
Stop Calling it a Media Query!

Stop Calling it a Media Query!

Sometimes there is confusion regarding what a media query actually is. Let's review some CSS terminology with an example.

So what part is actually the media query?

/* Isn't this a media query? Nope. */
@media
only screen and (max-width: 320px) and (min-device-pixel-ratio: 2),
@hparra
hparra / backgroundimages.sh
Created September 6, 2013 06:50
Reads directory for image files with @1x substring and creates retina-ready background-image LESS classes using Preboot's .retina-image mixin
#!/usr/bin/env bash
#
# backgroundimages.sh
#
# Reads directory for image files with @1x substring and
# Creates retina-ready background-image LESS classes using Preboot's .retina-image mixin
#
# Requires ImageMagick
#