Skip to content

Instantly share code, notes, and snippets.

View madastro's full-sized avatar

madastro madastro

View GitHub Profile
@madastro
madastro / animatedScrollTo.js
Created April 13, 2018 02:15 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@madastro
madastro / Readme.md
Created March 3, 2018 10:41 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@madastro
madastro / more.md
Created October 4, 2016 12:04 — forked from vasilisvg/more.md
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.

"""
Automatically add and update time stamps in your files.
On file open, will replace [timeStamp] with the current date and time.
Currently looks for two instances of this (example below).
To use, place the text [timeStamp] in your template file where you want it.
ex.
// CREATED: timeStamp
// MODIFIED: timeStamp
// Mixin that allows to specify arbitrary CSS properties with and output rem with pixel fallback.
// Shorthand assignments are supported too!
// Based off http://intuio.at/en/blog/an-improved-sass-rem-mixin-for-unitless-numbers/
$baseLine: 16px;
@mixin rem($property, $values)
{
// Placeholder variables
$shorthand_px: "";
$shorthand_rem: "";

How to remove hide the <select> arrow in Firefox using -moz-appearance:none;

Background

I was experimenting on custom styling the <select> elements of a form I was building. One of the things I tried implementing was truncating the text with an ellipsis in case it extended beyond the <select>'s width. It didn't look consistent through browsers, but I've accidentally discovered something really nice.

The bug