- Elasticsearch Internals
- Lucene Indexing
- Java Library
- Shard
- A shard is an instance of Lucene
- max # of documents in a shard is Integer.MAX_VALUE - 128
- clients do not refer to shards directly (use index instead
- What's in a shard?
- indexed document gets analyzed, put in buffer
- Lucene Indexing
- buffer defaults to 10% of node heap (set with indices.memory.index_buffer_size)
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
export default class GeoJsonMapLayer extends React.Component { | |
render() { | |
return ( | |
<div> | |
</div> | |
); | |
} | |
componentWillUnmount() { | |
if (this.layer) { |
title | slug | createdAt | language | preview |
---|---|---|---|---|
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom |
unit-testing-angular-js-app-with-node |
2015-07-05T18:04:33Z |
en |
Majority of search result about unit testing Angular.js apps is about how to do it by using test frameworks that run the tests in a real browser. Even though it's great to be able to test your code in multiple platforms, in my opinion it creates a lot of boilerplate code and makes it hard to run the tests in, for instance a CI-server. |
Lean unit tests with minimal setup
git clone git@gist.github.com:/f626d744a1e0a274c37c.git cf-import-test
cd cf-import-test
- Start a local server and load index.html in a browser.
- Less should complain that a CF mixin isn't present.
- Install CF:
bower install --save cfpb/capital-framework#dev
- Add
@import 'vendor/capital-framework/src/capital-framework.less';
to the top of main.less. - Reload the page and everything should look pretty.
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 one( foo ){ | |
return $.ajax({ | |
url: foo | |
}); | |
} | |
function two( bar ){ | |
return $.ajax({ | |
url: bar | |
}); |
Short Url: http://caseywatts.com/chromeextensionworkshop
Alternate Short Url: http://tinyurl.com/blatant-panda
Other gists & tricks: http://caseywatts.com/gists-and-tricks
- Inspiration - Some Chrome Extensions to Inspire You
(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.
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
// blog-post - http://www.delimited.io/blog/2013/12/8/chord-diagrams-in-d3 | |
//******************************************************************* | |
// CHORD MAPPER | |
//******************************************************************* | |
function chordMpr (data) { | |
var mpr = {}, mmap = {}, n = 0, | |
matrix = [], filter, accessor; | |
mpr.setFilter = function (fun) { | |
filter = fun; |
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
# Based on https://gist.github.com/fernandoaleman/5083680 | |
# Start the old vagrant | |
$ vagrant init ubuntu_saucy | |
$ vagrant up | |
# You should see a message like: | |
# [default] The guest additions on this VM do not match the install version of | |
# VirtualBox! This may cause things such as forwarded ports, shared | |
# folders, and more to not work properly. If any of those things fail on |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
NewerOlder