This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Recursively find the sum of nested arrays | |
| // NOTE: Need to pass initial value for accumulator!! | |
| // Otherwise, the accumulator is initialized as the first | |
| // element of the `data` array, `[1,2,3]` - NOT what we want! | |
| let data = [ [1,2,3], [2,3,4], [3,4, [5,6,7,8]]]; // 48 | |
| let recSum = function (acc, cur) { | |
| if (Array.isArray(cur)) cur = cur.reduce(recSum, 0); | |
| return acc + cur; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Hello World", | |
| "components": [ | |
| { | |
| "type": "Chart", | |
| "cardStyle": "Chart", | |
| "header": "My Pie Chart", | |
| "data": [ | |
| [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| title: 'Hello World', | |
| components: [ | |
| { | |
| type: 'Chart', | |
| cardStyle: 'Chart', | |
| header: 'My Pie Chart', | |
| data: [[{x: 1, y: 40}, {x: 2, y: 40}, {x: 3, y: 20}]], | |
| dataHandlers: ['NVD3.toPieChartSeries'], | |
| settings: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Hello World", | |
| "components": [{ | |
| "type": "Chart", | |
| "cardStyle": "Chart", | |
| "header": "My Pie Chart", | |
| "data": [ | |
| [{ | |
| "x": 1, | |
| "y": 40 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export var settings = { | |
| title: 'Hello World', | |
| components: [ | |
| { | |
| type: 'Chart', | |
| cardStyle: 'Chart', | |
| header: 'My Pie Chart', | |
| data: [[{x: 1, y: 40}, {x: 2, y: 40}, {x: 3, y: 20}]], | |
| dataHandlers: ['NVD3.toPieChartSeries'], | |
| settings: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "2", | |
| "header": { | |
| "title": "Parking Violations", | |
| "description": "This data set reflects parking violations reported by authorized agencies in Philadelphia. The data represented below is a sample of parking violations occurring between 2012-2015 with license plate numbers anonymized for privacy.", | |
| "navigation": [ | |
| { | |
| "label": "Download", | |
| "url": "https://data.phila.gov/api/views/3bxz-a5sb/rows.csv?accessType=DOWNLOAD&bom=true" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # GENERAL | |
| alias aliases="compgen -a" #list all aliases | |
| alias rmlasthost="sed -i '' -e '$ d' ~/.ssh/known_hosts" #remove last host key entry | |
| alias ls="ls -a" | |
| # ANSIBLE | |
| alias apb="ansible-playbook" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| autocmd Filetype javascript setlocal ts=2 sts=2 sw=2 | |
| set titlestring=%F\ %a%r%m | |
| let titlelen=70 | |
| set title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.userdocs.remove({parties : { $elemMatch : { email : 'ras.mashramani@gmail.com'}}}) | |
| db.userdocs.remove({parties : { $elemMatch : { email : 'ilegalimex@gmail.com'}}}) |