Skip to content

Instantly share code, notes, and snippets.

//https://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript
import { ScreenSize } from "./types";
export function isHighDensity() {
return (
(window.matchMedia &&
(window.matchMedia(
"only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)"
).matches ||
// Babel plugin to parse the AST and find where mixpanel events are called.
// This is used to generate the `mixpanel-report.json` file.
// https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
const fs = require('fs');
const _ = require('lodash');
const OUTPUT_PATH = './build-external/mixpanel-report.json';
sourcemaps: ui-server/build-external/index.html
export SENTRY_AUTH_TOKEN=$$SENTRY_AUTH_TOKEN; \
sentry-cli releases -o weaveworks -p service-ui new $(SHORT_HASH) && \
sentry-cli releases -o weaveworks -p service-ui files $(SHORT_HASH) upload-sourcemaps ui-server/build-external/ --url-prefix '~/service-ui' && \
rm -rf ui-server/build-external/*.js.map
@jpellizzari
jpellizzari / style.css
Created December 9, 2016 18:29
Zuroa CC Form
.form img { vertical-align: middle; }
.card-image-container {
float:left;
}
.card-image {
float:left;
}
// Change to getNodeDetails to make this work. Returns a promise to allow for chaining
export function getNodeDetails(topologyUrlsById, currentTopologyId, options, nodeMap, dispatch) {
// get details for all opened nodes
const obj = nodeMap.last();
if (obj && topologyUrlsById.has(obj.topologyId)) {
const topologyUrl = topologyUrlsById.get(obj.topologyId);
let urlComponents = [topologyUrl, '/', encodeURIComponent(obj.id)];
if (currentTopologyId === obj.topologyId) {
// Only forward filters for nodes in the current topology
const optionsQuery = buildOptionsQuery(options);
@jpellizzari
jpellizzari / snippets.cson
Last active May 15, 2016 17:10
Mocha and React shortcuts for Atom
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@jpellizzari
jpellizzari / package.json
Created December 1, 2015 04:40
React, ES6 project base
{
"name": "react-base",
"version": "1.0.0",
"description": "staring point for react projects",
"main": "index.js",
"ci": {
"nvm": "4.1.0"
},
"directories": {
"test": "test"
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
app: {
options: {
debug: false,
transform: ['reactify']
#wrapper {
width: 100%;
height: 700px;
margin: 0 auto;
}
#top {
background: #77ACF2;
border-radius: 10px;
width: 99%;
background: #f06;
table {
width: 900px;
background-color: #058;
}
.tr {
height: 20px;
width: 300px;