Skip to content

Instantly share code, notes, and snippets.

View shprink's full-sized avatar
🏠
Working from home

Julien Renaux shprink

🏠
Working from home
View GitHub Profile
@mixin paletteToCssVars($palette, $prefix) {
@each $key, $value in $palette {
@if #{$key} == 'contrast' {
@include paletteToCssVars($value, $prefix + '-contrast');
} @else {
--#{$prefix}-#{$key}: #{$value};
}
}
}
@shprink
shprink / _mixin.scss
Created October 16, 2018 17:32
Angular Material Sass to CSS variables
@function mat-color($palette-primary, $hue: default, $opacity: null) {
@if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
@return mat-color($palette-primary, default, $hue);
}
$color: map-get($palette-primary, $hue);
$opacity: if($opacity == null, opacity($color), $opacity);
@if type-of($opacity) == string {
$new-string: str-replace($color, ')', '-alpha, 1)');
[{"GENE_AM_FRVERSION":{"x":1480579256737,"value":132.74570750440242},"x":1480579256717},{"GENE_AM_FRVERSION":{"x":1480579257737,"value":132.59548161310022},"x":1480579257717},{"GENE_AM_FRVERSION":{"x":1480579258737,"value":132.4592377369233},"x":1480579258717},{"GENE_AM_FRVERSION":{"x":1480579259737,"value":132.34075164723976},"x":1480579259717},{"GENE_AM_FRVERSION":{"x":1480579260737,"value":132.24330699690168},"x":1480579260717},{"GENE_AM_FRVERSION":{"x":1480579261737,"value":132.1696043562665},"x":1480579261717},{"GENE_AM_FRVERSION":{"x":1480579262737,"value":132.1216862665448},"x":1480579262717},{"GENE_AM_FRVERSION":{"x":1480579263737,"value":132.10088070607463},"x":1480579263717},{"GENE_AM_FRVERSION":{"x":1480579264737,"value":132.1077642778781},"x":1480579264717},{"GENE_AM_FRVERSION":{"x":1480579265737,"value":132.14214620768396},"x":1480579265717},{"GENE_AM_FRVERSION":{"x":1480579266737,"value":132.20307366390406},"x":1480579266717},{"GENE_AM_FRVERSION":{"x":1480579267737,"value":132.28885810969572},"x
import React, { Component } from 'react';
import { format } from "d3-format";
import { timeFormat } from "d3-time-format";
import ReStock from "react-stockcharts";
const { ChartCanvas, Chart, series, scale, coordinates, tooltip, axes, helper } = ReStock;
const { LineSeries, AreaSeries, ScatterSeries, CircleMarker } = series;
const { discontinuousTimeScaleProvider } = scale;
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/test.png
@shprink
shprink / Ionic, scope CSS by state
Created February 16, 2016 16:42
Allow modifying any element by state and avoid CSS leaking
// JS
$rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState, fromParams) => {
// Add a timeout for ionic transitions
// For 500ms we will have both module classes
// so both modules will have the right css
// when transitionned we remove the previous module class
clearTimeout(stateChangeTimeout);
stateChangeTimeout = setTimeout(() => {
$document.find('html').removeClass(`${_.kebabCase(fromState.class || fromState.name)}`);
}, 500);
var gulp = require('gulp'),
runSequence = require('run-sequence'),
gulpif = require('gulp-if'),
argv = require('minimist')(process.argv.slice(2)),
uglify = require('gulp-uglify'),
clean = require('gulp-clean'),
minifyCss = require("gulp-minify-css"),
minifyHtml = require("gulp-minify-html"),
header = require("gulp-header"),
stripDebug = require('gulp-strip-debug'),
var js = [variables.bower + 'd3/d3.js',
variables.bower + 'd3-tip/index.js',
variables.bower + 'd3-cloud/d3.layout.cloud.js',
variables.bower + 'c3/c3.js',
variables.bower + 'topojson/topojson.js',
variables.bower + 'datamaps/dist/datamaps.all.js',
variables.bower + 'moment/moment.js',
variables.bower + 'moment/locale/en-gb.js',
variables.bower + 'moment/locale/fr.js',
variables.bower + 'moment/locale/es.js',