A Pen by Louis Hoebregts on CodePen.
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path |
angular.module('itemServices', ['ngResource']) | |
.factory('Item', ['$resource', | |
function ($resource) { | |
return $resource('items/:id', | |
{id: '@id'}, | |
{ | |
query: { | |
isArray: true, | |
method: 'GET', | |
params: {}, |
console.highlight = function(text, sample) { | |
var escapedSample = sample.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); | |
var reSample = new RegExp(escapedSample, 'g'); | |
var args = ['']; | |
var highlightedText = text.replace(reSample, function(match) { | |
args.push('background-color: #ffc', 'background-color: none'); | |
return '%c' + match + '%c'; | |
}); | |
args[0] = highlightedText; | |
console.log.apply(console, args); |
[ MouseMove / TouchSwipe ]
Scientists have recently discovered that the Milky Way Galaxy began with Globular Star Clusters and Dwarf Galaxies which formed a few hundred million years after the big bang, settling into what is now the galaxy's halo, merging over billions of years to form the structure of our Milky Way. Stars in the inner halo were born during the assembly process. Over time, the Milky Way gobbled up older dwarf galaxies that formed less than 2 billion years after the big bang, with their ancient stars settling into the outskirts of the halo, creating the outer halo.
A Pen by Tiffany Rayside on CodePen.
This is the French translation of Manuel Rego's (@regocas) post "Deep Dive into Grid Layout Placement", published on February 1st, 2016. All images and code samples come from the original article, with the author's permission. Translation: Patrick Brosset (@patrickbrosset).
Ceci est la traduction française de l'article "Deep Dive into Grid Layout Placement" par Manuel Rego (@regocas), publié le 1er Février 2016. Toutes les images et extraits de code viennent de l'article original avec la permission de l'auteur. Traduction: Patrick Brosset (@patrickbrosset).
// Hook in to `addEventListener` to track the mouse and display it as a circle | |
exports.onPageLoad = function() { | |
return browser.executeScript(function() { | |
(function() { | |
var EventSniffer = function() { | |
this.history = []; | |
this.callbacks = {}; | |
this.minCacheSize = 100; | |
this.maxCacheSize = 500; | |
}; |
import { Action, ActionReducer, Store } from '@ngrx/store'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
import { Observable } from 'rxjs/Observable'; | |
import { map } from 'rxjs/operator/map'; | |
import { Observer } from 'rxjs/Observer'; | |
// TODO: How to initialize those variables? | |
const dispatcherMock: Observer<Action>, | |
reducerMock: Observer<ActionReducer<any>>, | |
stateMock: Observable<any>; |
import { Platform } from '@angular/cdk/platform'; | |
import { NativeDateAdapter } from '@angular/material'; | |
import * as dayjs from 'dayjs'; | |
import 'dayjs/locale/de'; | |
import * as customParseFormat from 'dayjs/plugin/customParseFormat'; | |
import * as localizedFormat from 'dayjs/plugin/localizedFormat'; | |
/** | |
* Custom Date-Formats and Adapter (using https://github.com/iamkun/dayjs) |