Skip to content

Instantly share code, notes, and snippets.

View cdaz5's full-sized avatar

Chris D'Ascoli cdaz5

View GitHub Profile
function test() {
console.log('this is a test')
}
@cdaz5
cdaz5 / testing filename
Created July 5, 2017 12:32
testing descrip
function() {
console.log('test')
}
@cdaz5
cdaz5 / Pass by Value Example
Last active July 7, 2017 21:33
Javascript Pass by Value Example
let a = 5
let b = a
console.log(a) // => 5
console.log(b) // => 5
a = 1
console.log(a) // => 1
console.log(b) // => 5
@cdaz5
cdaz5 / Pass by Reference Example
Created July 7, 2017 16:39
Javascript Pass by Reference Example
let a = {language: "Javascript"}
let b = a
console.log(a) // => {language: "Javascript"}
console.log(b) => {language: "Javascript"}
a.language = "Ruby"
console.log(a) // => {language: "Ruby"}
console.log(b) // => {language: "Ruby"}
@cdaz5
cdaz5 / Fuzzy Search Includes Version
Last active August 3, 2017 17:19
Fuzzy Search Includes Version
sortBySearchTerm = () => {
return this.props.transactions.filter(transaction => {
return transaction.category.includes(this.props.searchTerm) || transaction.description.includes(this.props.searchTerm)
})
}
@cdaz5
cdaz5 / Regex Fuzzy Search
Created August 3, 2017 17:26
Regex Fuzzy Search
@cdaz5
cdaz5 / Intro.js Steps Sample State
Created August 21, 2017 13:02
Intro.js Steps State
state = {
stepsEnabled: true,
initialStep: 0,
steps: [
{
element: '.step1',
intro: 'Contains articles based on your interests.',
},
{
element: '.step2',
@cdaz5
cdaz5 / Sample Step 3
Created August 21, 2017 13:09
Sample Step 3
<span className='step3'><Icon size='large' color='blue' name='facebook official' />{this.renderFbShares()}</span>
@cdaz5
cdaz5 / Step Component
Created August 21, 2017 13:13
Step Component
<Steps
enabled={this.state.stepsEnabled}
steps={this.state.steps}
initialStep={this.state.initialStep}
onExit={this.onExit}
/>
@cdaz5
cdaz5 / onExit
Created August 21, 2017 13:18
onExit
onExit = () => {
this.setState({
stepsEnabled: false
})
}