Skip to content

Instantly share code, notes, and snippets.

View sephcoster's full-sized avatar

Seph Coster sephcoster

View GitHub Profile
@rosskarchner
rosskarchner / gist:2381ca5f8136f72b3718ca8353a7d5cc
Last active July 16, 2023 14:13
Notes from Elasticsearch Engineer II training
  • 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
  • buffer defaults to 10% of node heap (set with indices.memory.index_buffer_size)
@fab1an
fab1an / GeoJsonMapLayer.js
Last active January 10, 2022 03:50
React / Leaflet combination
export default class GeoJsonMapLayer extends React.Component {
render() {
return (
<div>
</div>
);
}
componentWillUnmount() {
if (this.layer) {
@rikukissa
rikukissa / POST.md
Last active January 27, 2020 08:10
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom #angular.js #testing
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.

Testing Angular.js app headlessly with node.js + mocha

Lean unit tests with minimal setup

@contolini
contolini / --steps.md
Last active August 29, 2015 14:21
cf import test
  1. git clone git@gist.github.com:/f626d744a1e0a274c37c.git cf-import-test
  2. cd cf-import-test
  3. Start a local server and load index.html in a browser.
  4. Less should complain that a CF mixin isn't present.
  5. Install CF: bower install --save cfpb/capital-framework#dev
  6. Add @import 'vendor/capital-framework/src/capital-framework.less'; to the top of main.less.
  7. Reload the page and everything should look pretty.
function one( foo ){
return $.ajax({
url: foo
});
}
function two( bar ){
return $.ajax({
url: bar
});
@caseywatts
caseywatts / 0 - Chrome Workshop.md
Last active August 30, 2023 06:48
Chrome Extension Workshop
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@sghall
sghall / gist:7859113
Last active August 3, 2018 11:37
Helper function for creating a d3 chord diagram
// 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;
# 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
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

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.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>