Skip to content

Instantly share code, notes, and snippets.

View rlucha's full-sized avatar

Rob Lucha rlucha

View GitHub Profile
@rlucha
rlucha / findStyles.js
Last active November 20, 2019 12:22 — forked from macbookandrew/findStyles.js
List unique CSS properties for all DOM elements
/**
* List unique CSS properties for all DOM elements
* Initially created to list unique font stacks on a page
* @see {@link http://stackoverflow.com/a/35022690/ Inspired by this StackOverflow answer}
*
* @see {@link https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a/ URL for this file}
*
* @author AndrewRMinion Design (https://andrewrminion.com)
* @version 1.1
*
@rlucha
rlucha / for-snook.md
Created December 14, 2018 04:57 — forked from threepointone/for-snook.md
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21 ‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css in js is selectors.

The biggest win from cij is that computers generate selectors for you a

@rlucha
rlucha / .zshrc
Created October 16, 2018 08:17 — forked from matthewmccullough/.zshrc
A configuration to maintain history across sessions and share it across terminals in ZShell
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
@rlucha
rlucha / degress2meters.js
Created June 5, 2018 16:55 — forked from springmeyer/degress2meters.js
convert from long/lat to google mercator (or EPSG:4326 to EPSG:900913)
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
x= -77.035974
y = 38.898717
@rlucha
rlucha / console_patch.js
Created December 9, 2015 08:29 — forked from FGRibreau/console_patch.js
Add timestamp information to the JavaScript console
/**
* Patch the console methods in order to provide timestamp information
*
* Usage:
* > console.log('ok')
* 2012-09-06T11:52:56.769Z ok true
*
* Note:
* The patch will only be applied with the first call.
*
/**
* AngularJS service to validate spanish document id.
* Returns the type of document and checks its validity.
*
* Usage:
* angular
* .module('myApp', [ 'validate-spanish-id' ])
* .controller('myController', function(ValidateSpanishID){
* ValidateSpanishID.validate( str );
* })
/**
* AngularJS service to validate spanish document id.
* Returns the type of document and checks its validity.
*
* Usage:
* angular
* .module('myApp', [ 'validate-spanish-id' ])
* .controller('myController', function(ValidateSpanishID){
* ValidateSpanishID.validate( str );
* })