Skip to content

Instantly share code, notes, and snippets.

/*
yarn add chrome-remote-interface
yarn add lighthouse
node run headless_chromium.js
*/
const chrome = require('chrome-remote-interface');
const { ChromeLauncher } = require('lighthouse/lighthouse-cli/chrome-launcher');
const _ = require('lodash');
import Mocha from 'mocha';
import glob from 'glob';
import _ from 'lodash/lodash';
import chai from 'chai';
import { shallow, mount, render } from 'enzyme';
import chaiEnzyme from 'chai-enzyme';
glob('webroot/components/**/tests/**/*.js', (err, files) => {
var runner = new Mocha({
ui: 'bdd',
@xiankai
xiankai / mocha.html
Last active April 12, 2017 18:19
jspm mocha-phantomjs config
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="jspm_packages/npm/mocha@2.4.5/mocha.css" rel="stylesheet" />
</head>
<body>
<div id="mocha"></div>
<script src="jspm_packages/system.js"></script>
@xiankai
xiankai / karma.conf.js
Last active May 19, 2016 12:13
jspm karma config
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: 'webroot',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [
@keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}
@-moz-keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
100% {background-position: 400px 1000px, 200px 400px, 100px 300px;}
@xiankai
xiankai / Builder Pattern
Created October 3, 2013 09:46
This is a base pattern for doing simple get/set operations in Codeigniter, with the ability to extend them at will.
<?php
class ORMModel extends CI_Model {
public function __construct() {
parent::__construct();
}
public function __call($name, $args) {
$method = strtolower(substr($name, 0, 3));