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
<?php | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
/* | |
jQuery.reduce - a jQuery plugin for functional programming | |
@author John Hunter | |
created 2010-09-17 | |
use: $.reduce(arr, fnReduce, valueInitial); | |
fnReduce is called with arguments: [valueInitial, value, i, arr] | |
reduce will never be jQuery core - its not prototype :p (http://dev.jquery.com/ticket/1886) | |
*/ | |
(function ($) { |
# ---------------------------------------------------------------------- | |
# Webfont access | |
# ---------------------------------------------------------------------- | |
# allow access from all domains for webfonts | |
# alternatively you could only whitelist | |
# your subdomains like "sub.domain.com" | |
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$"> | |
<IfModule mod_headers.c> |
<!doctype html> | |
<html> | |
<body> | |
<header role="banner"> | |
<a href="/" rel="home">My company</a> | |
<nav role="navigation"> | |
<a href="/about">About</a> | |
<a href="/contact">Contact</a> | |
</nav> | |
</header> |
set $ssl off; | |
if ($ssl_protocol != "" ) { | |
set $ssl on; | |
} | |
fastcgi_param HTTPS $ssl; |
# webm | |
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
# mp4 | |
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
# ogg (if you want to support older Firefox) | |
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
/* | |
fileExistSync - Check if a file exist in NodeJS | |
Twitter: @FGRibreau / fgribreau.com | |
Usage: | |
var fileExistSync = require('./fileExistSync'); | |
var exist = fileExistSync('/var/folders/zm/jmjb49l172g6g/T/65b199'); | |
Support for Nodev0.6 |
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(0%); | |
} |
// Kudos to Grumdrig | |
// http://stackoverflow.com/questions/1207008/how-do-i-lock-the-orientation-to-portrait-mode-in-a-iphone-web-application | |
$(document).ready(function () { | |
function reorient(e) { | |
var portrait = (window.orientation % 180 == 0); | |
$("body > div").css("-webkit-transform", !portrait ? "rotate(-90deg)" : ""); | |
} | |
window.onorientationchange = reorient; | |
window.setTimeout(reorient, 0); |