Instance | Branch |
---|
$(document).ready(function() { | |
/* Hide all elements outside the visible window */ | |
$('body *').each( function(){ | |
var top_of_object = $(this).position().top; | |
var bottom_of_window = $(window).scrollTop() + $(window).height(); | |
if( bottom_of_window < top_of_object ){ | |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/// <reference path="../node_modules/angular2/core.d.ts" /> | |
/// <reference path="../node_modules/angular2/platform/browser.d.ts" /> | |
/// <reference path="../node_modules/angular2/common.d.ts" /> | |
import { Component, View, Directive, Input, ElementRef, Output, EventEmitter } from 'angular2/core'; | |
import { bootstrap } from 'angular2/platform/browser'; | |
//remove the host of avatar to be rendered as svg | |
@Directive({ |
/* | |
works with JQ | |
usage | |
<p class="targetElement">Text to scale</p> | |
$('.targetElement').scaleFontSize({minFontsize: 12}); | |
minFontsize минимальное размер шрифта для уменьшения, default 16px. | |
Определяется переполнение по ширине и высоте. | |
Определение переполнения по высоте работает если элементу задан height. |
Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.
var platform = { | |
ipad: /iPad/.test(navigator.userAgent) && !window.MSStream, | |
ios: /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, | |
safari: navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1 && !window.MSStream, | |
mac: navigator.platform.toLowerCase().indexOf('mac') >= 0 && !window.MSStream, | |
android: /(android)/i.test(navigator.userAgent) || navigator.platform.toLowerCase().indexOf("android") > -1 && !window.MSStream, | |
firefox: navigator.userAgent.toLowerCase().indexOf('firefox') > -1 && !window.MSStream, | |
windows: navigator.platform.indexOf('Win') > -1 && !window.MSStream, | |
ie: !!window.MSInputMethodContext && !!document.documentMode && !window.MSStream | |
}; |
This recipe is useful for cooking up chained API calls as a result of a single action.
In the below example, a single action called POST_REPO
is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API:
- POST a new repostiry
- GET the master branch of the new repository
- GET the files on the master branch
It's not so hard to find sample data and data sources to use for interesting side-projects, or just for practicing writing SQL.
Most DBMSes come with sample databases. You can write lots of interesting queries against them, and usually a tutorial accompanies the database in the documentation.
- Documentation for Microsoft SQL Server's samples ** Microsoft's sample database GitHub, which includes the Contoso database
- For MySQL:
- there's the Employees sample database
- and the Sakila sample database