This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bindToSeparateDateFieldFactory ($rootScope, $parse) { | |
return function (context, srcExpression, targetExpression) { | |
var getTarget = $parse(targetExpression), | |
setTarget = getTarget.assign, | |
getSrc = $parse(srcExpression), | |
setSrc = getSrc.assign; | |
$rootScope.$watch( | |
function () { return getTarget(context); }, | |
function (newValue) { newValue && setSrc(context, newValue + 'T00:00:00.000Z'); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-animated-pages/core-animated-pages.html"> | |
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html"> | |
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-down.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-up.html"> | |
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var injector = angular.injector(['ng']); | |
injector.instantiate(function ($http) { | |
window.$http = $http; | |
}); | |
$http.get('https://whatever.com'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Immutable = require('immutable'); | |
var list = Immutable.List.of(1,2,3,4,5,6,7); | |
var result = | |
list | |
.map(function (x) { return x*x; }) | |
.filter(function (x) { return x < 10 }) | |
.reduce(function (acc, x) { return acc + x }) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
const int listSize = 1000; | |
const int sampleSize = 10000; | |
var sortedList = Enumerable.Range(0,listSize).ToList(); | |
var unsortedList = new List<int>(sortedList); | |
var sortedCount = 0; | |
sortedList.Sort((l,r) => {sortedCount++; return l - r;}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function crMatches () { | |
return { | |
require: 'ngModel', | |
scope: { | |
crMatches: '=' | |
}, | |
link: function(scope, elem, attrs, ctrl) { | |
scope.$watch('crMatches', function (newValue) { | |
if (newValue) { ctrl.$setValidity('matches', newValue === elem.val()); } | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normal variable: | |
var x = 7; | |
// Used like: | |
console.log(x); // => 7 | |
// Variable declared in a loop | |
for(var i = 0; i < 3; i++) { | |
// Used like: | |
console.log(i); // => 0,1,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rexml/document" | |
include REXML | |
file = File.new( "String Quartet No. 3 in G Major, K. 156.xml" ) | |
doc = Document.new file | |
notes = XPath.match( doc, "//note/pitch[step='C' and octave='5' and not(alter)]" ) | |
puts notes.length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>this</title> | |
</head> | |
<body> | |
<div><a id="broken" href="#">Incorrectly bound click</a></div> | |
<div><a id="working" href="#">Correctly bound click</a></div> | |
<div><a id="working2" href="#">Also correctly bound click</a></div> | |
<script> |
OlderNewer