As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
#!/bin/bash | |
# Install Monaco font in Linux | |
# Version from nullvideo https://gist.github.com/rogerleite/99819#gistcomment-2799386 | |
sudo mkdir -p /usr/share/fonts/truetype/ttf-monaco && \ | |
sudo wget https://gist.github.com/rogerleite/b50866eb7f7b5950da01ae8927c5bd61/raw/862b6c9437f534d5899e4e68d60f9bf22f356312/mfont.ttf -O - > \ | |
/usr/share/fonts/truetype/ttf-monaco/Monaco_Linux.ttf && \ | |
sudo fc-cache |
function resize( imagewidth, imageheight, thumbwidth, thumbheight ) { | |
var w = 0, h = 0, x = 0, y = 0, | |
widthratio = imagewidth / thumbwidth, | |
heightratio = imageheight / thumbheight, | |
maxratio = Math.max( widthratio, heightratio ); | |
if ( maxratio > 1 ) { | |
w = imagewidth / maxratio; | |
h = imageheight / maxratio; | |
} else { | |
w = imagewidth; |
/* | |
* This decorates Handlebars.js with the ability to load | |
* templates from an external source, with light caching. | |
* | |
* To render a template, pass a closure that will receive the | |
* template as a function parameter, eg, | |
* T.render('templateName', function(t) { | |
* $('#somediv').html( t() ); | |
* }); | |
* Source: https://github.com/wycats/handlebars.js/issues/82 |
;(function($){ | |
var touch = {}, | |
touchTimeout, tapTimeout, swipeTimeout, | |
longTapDelay = 750, longTapTimeout | |
function parentIfText(node) { | |
return 'tagName' in node ? node : node.parentNode | |
} | |
function swipeDirection(x1, x2, y1, y2) { |
// -------------------------------------------------- | |
// Flexbox LESS mixins | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// Flexbox display | |
// flex or inline-flex | |
.flex-display(@display: flex) { | |
display: ~"-webkit-@{display}"; | |
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |
// tests | |
// returns height of the screen including all toolbars | |
// requires detection of orientation. (320px for our test) | |
// window.orientation === 0 ? screen.height : screen.width | |
// returns height of the visible area | |
// it decreases if you zoom in | |
// window.innerHeight | |
// returns height of screen minus all toolbars |
.flex() { | |
display: -webkit-box; | |
display: -moz-box; | |
display:-webkit-flex; | |
display: -ms-flexbox; | |
display:flex; | |
} | |
.flex-justify(@justifyStyle) { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
-moz-appearance
to none
. This will "reset" the styling of the element;text-indent
to 0.01px
. This will "push" the text a tiny bit[1] to the right;