Some vanilla equivalents to jQuery methods.
jQuery:
var IE = (function() { | |
if (document.documentMode) { | |
return document.documentMode; | |
} else { | |
for (var i = 7; i > 4; i--) { | |
var div = document.createElement("div"); | |
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->"; | |
if (div.getElementsByTagName("span").length) { |
var requestAnimationFrame = window.requestAnimationFrame || (function() { | |
var timeLast = 0; | |
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { | |
var timeCurrent = (new Date()).getTime(), | |
timeDelta; | |
/* Dynamically set the delay on a per-tick basis to more closely match 60fps. */ | |
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671. */ | |
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast)); |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
This is shell project for configuring a typical project for angular 2.x. It includes the most naive example of an angular 2.x project. This uses some of the typical tools: webpack, karma, jasmine, typescript, sass.
Inspired by https://github.com/jeffbcross/aim
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
/** | |
* Uncamelize a string, joining the words by separator character. | |
* @param string Text to uncamelize | |
* @param string Word separator | |
* @return string Uncamelized text | |
*/ | |
function uncamelize(text, separator) { | |
// Assume separator is _ if no one has been provided. | |
if(typeof(separator) == "undefined") { |