Skip to content

Instantly share code, notes, and snippets.

Ben Hughes benhughes

  • London
Block or report user

Report or block benhughes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@benhughes
benhughes / PrettierFile.js
Last active Aug 31, 2019
Changing default to true
View PrettierFile.js
const {prettier, parserBabylon} = importModule('./prettier-scriptable');
const prettierConfig = {
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: false,
parser: 'babel',
plugins: [parserBabylon],
};
View prettier-scriptable.js
This file has been truncated, but you can view the full file.
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
View react-statless-funcs.md

#A brief intro into Stateless functions#

So stateless functions are new in React 0.14 which are quite interesting. They look a bit like this.

const Test = ({name, amount}) => {
  return <div className="test">{name} has £{amount}</div>;
};

ReactDOM.render(<Test name="ben" amount="-2000" />) //  <div className="test">ben has £-200</div> 
@benhughes
benhughes / .jshintrc
Last active Jan 4, 2016
My default jshintrc file
View .jshintrc
{
"undef": true,
"unused": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"immed": true,
"indent": 4,
You can’t perform that action at this time.