Skip to content

Instantly share code, notes, and snippets.

View nshimiye's full-sized avatar

Marcellin Nshimiyimana nshimiye

View GitHub Profile
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@nshimiye
nshimiye / api models Locations.js
Created December 6, 2016 00:28 — forked from juanpasolano/api models Locations.js
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[
@nshimiye
nshimiye / box-shadow.html
Created April 5, 2018 05:23 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@nshimiye
nshimiye / box-shadow.html
Created April 5, 2018 05:23 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@nshimiye
nshimiye / .babelrc
Created November 7, 2018 00:57
polyfill example with babel 6
{
"presets": [
[
"env", {
"targets": {
"browsers": ["ie >= 9", "safari >= 7"]
},
"useBuiltIns": "usage"
}
]
var a = 2;
@nshimiye
nshimiye / Babel-6-polyfill-example.md
Last active November 7, 2018 01:40
Object.assign Polyfill example with Babel 6

Showcasing how Babel 6 includes unnecessary polyfill code

@nshimiye
nshimiye / oassign-code.js
Created November 7, 2018 01:49
code with object.assign in it
import "babel-polyfill";
const backendResponse = [
{ title: '', timestamp: '1960-04-15T18:34:38+05:00' },
{ title: '', timestamp: '2007-05-15T18:34:38+05:00' }
];
const timeline = backendResponse.map(event => {
const date = new Date(event.timestamp).toLocaleDateString('en-US');
return Object.assign(event, { date }); // <=
const input = [
{ label: '08/01', dailySale: 5 },
{ label: '08/02', dailySale: 18 },
{ label: '08/03', dailySale: 12 },
{ label: '08/04', dailySale: 8 },
{ label: '08/05', dailySale: 12 },
{ label: '08/06', dailySale: 9 },
{ label: '08/07', dailySale: 5 },
{ label: '08/08', dailySale: 5 },
{ label: '08/09', dailySale: 5 },
export function createChartjsData(breakdown) {
const [labels, dailySales] = breakdown.reduce(
(acc, { label, dailySale }) => {
const [labelList, saleList] = acc;
return [
[...labelList, label],
[...saleList, dailySale],
];
},
[[], []],