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
d3.transform = function(string) { | |
d3_transformG.setAttribute("transform", string); | |
var m = d3_transformG.transform.baseVal.consolidate().matrix; | |
if (m.a * m.d - m.b * m.c) return new d3_transform(m); // if invertible | |
}; | |
// Compute x-scale and normalize the first row. | |
// Compute shear and make second row orthogonal to first. | |
// Compute y-scale and normalize the second row. | |
// Finally, compute the rotation. |
// Media Queries in Sass 3.2 | |
// | |
// These mixins make media queries a breeze with Sass. | |
// The media queries from mobile up until desktop all | |
// trigger at different points along the way | |
// | |
// And important point to remember is that and width | |
// over the portrait width is considered to be part of the | |
// landscape width. This allows us to capture widths of devices | |
// that might not fit the dimensions exactly. This means the break |
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
(function(win, doc){ | |
if(win.addEventListener)return; //No need to polyfill | |
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
function addEvent(on, fn, self){ | |
return (self = this).attachEvent('on' + on, function(e){ | |
var e = e || win.event; | |
e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |
(function() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
require 'tumblr_client' | |
require 'mechanize' | |
require 'date' | |
require 'yaml' | |
require 'uri' | |
Tumblr.configure do |config| | |
config.consumer_key = "consumer_key" | |
config.consumer_secret = "consumer_secret" | |
config.oauth_token = "oath_token" |
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["ctrl"], | |
"press_command": "drag_select", |
It's easy to trip up on the meaning of this
in JavaScript. The behavior is very different from other languages, which means we have to throw most preconceptions and intuition out the window.
The best way to think of this
in JS is as a hidden function argument which is passed in a slightly awkward way. Instead of the normal passing of arguments:
fn(arg1, arg2, arg3)
/** | |
* Add ipad IOS7 Classes | |
* Allows us to temporariliy try to fix the slight scroll 100% hack. | |
* http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue | |
*/ | |
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) { | |
$('html').addClass('ipad ios7'); | |
} | |
/** |
<?php | |
$domain = "img.scottshar.es/"; | |
//server-side directory | |
$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); | |
$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self; | |
// Image filetype check source: | |
// http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/ | |
$tempFile = $_FILES['media']['tmp_name']; |