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
case class Context(local: Boolean) | |
trait FileSource { | |
def readFile(location: String): String | |
def writeFile(location: String, content: String): Unit | |
} | |
object FileSource { | |
def apply(context: Context): FileSource { | |
if (context.local) new LocalFileSource(context) else new ExternalFileSource(context) | |
} |
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
def walk[T](caseClass: T): Iterator[String] = caseClass match { | |
case string: String => Iterator(string) | |
case product: Product => product.productIterator.flatMap(walk) | |
case _ => Iterator() | |
} | |
if (walk(config).contains(null)) { | |
throw new Exception("Case class structure has null") | |
} |
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
case class Color(value: String, name: String) |
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
<script> | |
define('compare', () => ({ | |
isEqual(sub1, sub2) { | |
return sub1 + sub2 | |
}, |
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
'use strict'; | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var MyElement = function MyElement() { | |
_classCallCheck(this, MyElement); | |
this.is = 'my-element'; | |
this.properties = { |
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
// Currently fails in Polymer | |
class MyElement { | |
is = 'my-element' | |
properties = { | |
greeting: { | |
type: String, |
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
<dom-module id="interfaced-el"> | |
<template> | |
</template> | |
<script> | |
Polymer({ | |
is: 'interfaced-el', |
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
Polymer.Collection._parseKey (polymer.0.js:3753) | |
Polymer.Collection.setItem (polymer.0.js:3759) | |
Polymer.Base._addFeature.set (polymer.0.js:2001) | |
(anonymous function) (polymer.0.js:1494) | |
Polymer.Base._addFeature._notifyListener (polymer.0.js:1923) | |
Polymer.Base._addFeature.fire (polymer.0.js:1288) | |
Polymer.Bind._modelApi._notifyChange (polymer.0.js:1359) | |
Polymer.Base.extend._notifyEffect (polymer.0.js:1530) | |
(anonymous function) (polymer.0.js:1393) | |
Polymer.Bind._modelApi._effectEffects (polymer.0.js:1390) |
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
- Gigabyte G1 | |
- Pros | |
- Best look for my build (Air) | |
- Most well-regarded binning | |
- Cons | |
- Some cards have coil whine issues | |
- Zotac AMP! Extreme | |
- Pros | |
- Largest heatsink, most effective cooling (Air) | |
- Ships with highest clock |
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
context.setErrorHandler(new ErrorHandler() { | |
@Override | |
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { | |
baseRequest.setHandled(true); | |
String method = request.getMethod(); | |
if (!method.equals(HttpMethod.GET) && !method.equals(HttpMethod.POST) && !method.equals(HttpMethod.HEAD)) { | |
return; | |
} | |
response.setContentType(MimeTypes.Type.TEXT_PLAIN_8859_1.toString()); | |
response.setHeader(HttpHeader.CACHE_CONTROL.toString(), "must-revalidate,no-cache,no-store"); |