From: StackOverflow
document.getElementById("MyElement").className = "MyClass";
document.getElementById("MyElement").className += " MyClass";
import org.junit.runner.*; | |
import org.junit.experimental.categories.*; | |
import org.junit.runners.*; | |
/** | |
* For use with testing a bug with Junit 4.8.1 | |
**/ | |
@RunWith(Categories.class) | |
@Categories.IncludeCategory(Development.class) | |
@Suite.SuiteClasses({MytestClass.class}) | |
public class Development |
From: StackOverflow
document.getElementById("MyElement").className = "MyClass";
document.getElementById("MyElement").className += " MyClass";
import React, { PropTypes } from 'react'; | |
@reactor | |
class Child extends React.Component { | |
componentDidMount() { | |
console.log('Child mounted with context reactor:', this.context.reactor); | |
} | |
render() { | |
return <span>Child Component</span>; | |
} |
# | |
# How to tail files constantly for a string | |
# | |
tail -f *.log | grep --line-buffered PHIL |
'use strict'; | |
const autoprefixer = require('autoprefixer'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); | |
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); | |
const eslintFormatter = require('react-dev-utils/eslintFormatter'); |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
// Restify Server CheatSheet. | |
// See: http://journal.gentlenode.com/node-3-restify-cheatsheet/ | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
U2FsdGVkX18bL0goCbiTjHFGnkwWagZSYjhvkaU1hXA= |
// I needed something to create a string of characters for testing, Im lazy. | |
// Generate Full Range of Chars | |
// I needed something to create a string of characters for testing, Im lazy. | |
var res = ''; | |
for ( var i = 33; i<=126; i++ ) { | |
res = res + String.fromCharCode(i); | |
console.log('i=',i,String.fromCharCode(i)); | |
} | |
console.log( 'res=', res ); |
/** | |
* Sequentially execute an array of functions that return promises. | |
* @example: | |
* .then((data)=>{ | |
* const functions = data.map( (body) => { | |
* return () => { | |
* return requestPromise({ | |
* method: 'PATCH', | |
* uri: `${HOST}:${PORT}/update`, | |
* headers: {Authorization: `JWT ${token}`}, |