Skip to content

Instantly share code, notes, and snippets.

View rakannimer's full-sized avatar
💭
I may be slow to respond.

Rakan Nimer rakannimer

💭
I may be slow to respond.
View GitHub Profile
import React from 'react'
import {render} from 'react-dom'
import {Chart} from 'react-google-charts'
class App extends React.Component{
constructor(props) {
super(props);
}
onSelectEvent(Chart) {
console.log(Chart.chart.getSelection());
import React from 'react'
import {render} from 'react-dom'
import {Chart} from 'react-google-charts'
export default class App extends React.Component {
constructor(props) {
super(props)
this.state = {
data: [],
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^3.6.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.3.0"
}
@rakannimer
rakannimer / .eslintrc
Created October 20, 2016 12:35
My eslint
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/prefer-default-export": "off",

command

adb shell input keyevent 0

Name

KEYCODE_UNKNOWNI

index

C

@rakannimer
rakannimer / some atom snippets.cson
Last active November 25, 2016 13:59
Some atom snippets
# 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:
#
@rakannimer
rakannimer / add-react-jest-airbnb-linting.sh
Last active August 14, 2018 07:42
Adding react-airbnb styleguide linting to create-react-app
( export PKG=eslint-config-airbnb; npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add -D "$PKG@latest"; )
yarn add babel-eslint
echo "{
\"parser\": \"babel-eslint\",
\"env\": {
\"browser\": true,
\"node\": true,
\"jest\": true,
},
\"extends\": \"airbnb\",
@rakannimer
rakannimer / add-jest-to-nwb.sh
Last active April 14, 2019 02:29
Adding jest tests to nwb project
yarn add -D jest babel-jest babel-preset-es2015 babel-preset-react react-test-renderer
#Edit package.json adding the jest command :
"scripts": {
"build": "nwb build-react-component",
"clean": "nwb clean-module && npm clean-demo",
"start": "nwb serve-react-demo",
"test": "nwb test",
"test:coverage": "nwb test --coverage",
"test:watch": "nwb test --server",
"test:jest": "jest"
@rakannimer
rakannimer / jest-photoshoot.js
Created January 15, 2017 12:28
Jest Photoshoot micro helper function
const photoshoot = (...args) => {
args.forEach(arg =>
expect(arg).toMatchSnapshot()
);
};
@rakannimer
rakannimer / mobx-reactions-example.js
Last active August 31, 2017 09:46
mobx reactions quick tldr
import { reaction, observable, runInAction } from 'mobx';
const myObservableMap = observable.map({});
const disposeReaction = reaction(() => myObservableMap, (newObservableValue) => {
console.warn('Someone changed the observable map. new value : ', newObservableValue);
})
myObservableMap.set('some', {data: 'of any type'})
myObservableMap.set('someOther', 'data')