I hereby claim:
- I am everdimension on github.
- I am everdimension (https://keybase.io/everdimension) on keybase.
- I have a public key ASDZ-VkHtJ_900M-VqWOsuxU_ZJPPpICcOXL6n6qnecOhQo
To claim this, I am signing this object:
// sample data for trying | |
var paramsString = "?lunch=sandwich&dinner=stirfry"; | |
console.log(parseParams(paramsString)); | |
// | |
// main function | |
// | |
function parseParams(str) { | |
return str | |
.replace(/(^\?)/, '') |
// DrawerApi.js | |
// ** code from demo ommitted ** | |
// | |
// AnotherApi.js | |
import Api from '../src/redux-apis'; | |
export default class AnotherApi extends Api { | |
constructor(state = { drawerIsOpened: false }) { | |
super(state); |
class Store { | |
constructor(reducer, initialState) { | |
this.reducer = reducer; | |
this.state = this.reducer(initialState, {}); | |
console.log('set state', this.state); | |
this.listeners = []; | |
} | |
getState() { | |
return this.state; |
angular.module('app.directives.svgBaseFix', []) | |
.directive('svgBaseFix', function($rootScope) { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
var attr = 'xlinkHref'; | |
var initialUrl = attrs[attr]; | |
var parsingNode = document.createElement('a'); |
/* global document */ | |
import { KEY_CODES } from './data/constants'; | |
export default function initTabSpy() { | |
document.body.classList.add('isUsingPointer'); | |
document.addEventListener('keydown', (evt) => { | |
if (evt.which === KEY_CODES.TAB) { // or may be any keydown? | |
document.body.classList.remove('isUsingPointer'); | |
} | |
}); |
#!/bin/bash | |
# Creates the following structure | |
# | - ComponentName | |
# | - ComponentName.js | |
# | - ComponentName.css | |
# | - index.js | |
createComponent() { | |
mkdir $1 |
I hereby claim:
To claim this, I am signing this object:
function isNumericValue(n) { | |
return !isNaN(Number(n) - parseFloat(n)); | |
} |
const ActuallyUsedComponent = () => ( | |
<div> | |
/* some layout and markup that doesn't depend on global state */ | |
<Connect mapStateToProps={mapStateToProps} mapPropsToActions={actions}> | |
/* some markup where the props from connect are actually needed */ | |
</Connect> | |
<Route | |
path="..." | |
component={() => ( | |
<div> |
function arraySum(arr) { | |
return arr.reduce((sum, next) => sum + next, 0); | |
} | |
function padLeft(string, size) { | |
let res = string; | |
while (res.length < size) { | |
res = `0${res}`; | |
} | |
return res; |