Skip to content

Instantly share code, notes, and snippets.

@chantalgo
chantalgo / group-objects-by-property.md
Created January 15, 2020 09:57 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@chantalgo
chantalgo / index.html
Created August 26, 2016 20:13 — forked from anonymous/index.html
testing on jsbin [mocha template] // source http://jsbin.com/kifeki
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[mocha template]">
<meta charset="utf-8">
<title>testing on jsbin</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.css">
</head>
<body>
<div id="mocha"></div>
val cutoff year country
6910 cop5 1981 Australia
6864 cop5 1985 Australia
6555 cop5 1989 Australia
6551 cop5 1995 Australia
7002 cop5 2001 Australia
7090 cop5 2003 Australia
8818 cop5 1987 Austria
8744 cop5 1994 Austria
5813 cop5 1995 Austria
@chantalgo
chantalgo / index.html
Last active August 29, 2015 14:25
Update1
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
body {
font-family: 'arial', sans-serif;
font-size: 12px;
width:720px;
margin: 20px auto;
@chantalgo
chantalgo / index.html
Last active August 29, 2015 14:23
D3Viz Class 01: Exercise
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
svg {
border: 1px solid #C6c;
}
circle {
@chantalgo
chantalgo / Text-input-love.markdown
Created August 18, 2014 21:13
A Pen by Michael Arestad.

Text input love

I wanted to play with some input styles that don't rely on hover, don't add clutter, show the label at all times, and show placeholder text when it is actually relevant.

A Pen by Michael Arestad on CodePen.

License.

/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@chantalgo
chantalgo / new_gist_file
Created June 7, 2013 19:32
JS Fiddle pull from github
http://jsfiddle.net/gh/gist/library/pure/
http://jsfiddle.net/gh/gist/d3/3.0.4/
@chantalgo
chantalgo / git.md
Last active April 19, 2022 23:47
Git info init!

Start a repo

Initialize a repository git init

Command to see what the current state of our project git status

To start tracking changes made to a file, it needs to be added to the staging area git add

@chantalgo
chantalgo / blogrss.js
Created May 25, 2013 01:53
Blog reader data extractor [static]
(function () {
"use strict";
// Set up array variables
var dataPromises = [];
var blogs;
// Create a data binding for our ListView
var blogPosts = new WinJS.Binding.List();