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
alias bashdir='cd ~' | |
alias atom='open -a "Atom"' | |
alias prof='atom ~/.bash_profile' | |
alias cassandra='cd ~/Documents/Cassandra/datastax-ddc-3.4.0/bin && ./cassandra' | |
alias ms='cd ~/Documents/ONEHOPE/microservice' | |
alias hc='cd ~/hopecommerce-proto' | |
alias devApp='cd ~/hopecommerce-proto && npm run dev-a' | |
alias devGQL='cd ~/hopecommerce-proto && npm run dev-g' | |
alias rDev='cd ~/Documents/ONEHOPE/microservice && npm run dev' |
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
/** | |
* Let's say you have | |
* function getPromoCodeErrors(accountId, cart, cartProductItems, cartItems) | |
* | |
* If you don't have one or more of these parameters, then you need nulls in to fill out the parameters | |
* getPromoCodeErrors(accountId, null, null, cartItems) | |
* | |
* With the below this is valid | |
* getPromoCodeErrors({accountId, cartItems}) | |
* |
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 makeAsyncScriptLoader from 'react-async-script'; | |
const BillingInformationForm = () => (<div>Stripe!</div>) | |
export const BillingInformationFormAsync = makeAsyncScriptLoader(BillingInformationForm, 'https://js.stripe.com/v2/', { | |
globalName: 'Stripe', | |
callbackName: 'stripeCallBack', | |
}); |
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 soap from 'soap'; | |
import moment from 'moment'; | |
const taxServiceUrl = 'http://hehexd.com/services/1.2/taxservice.asmx?WSDL' | |
export function generateJsonForTaxRate(json) { | |
const EffectiveDate = moment().toISOString(); | |
const { | |
city: City, | |
state: State, | |
addressLineOne: Street1, |
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
//old: productReviews.js - lines 121 - 125 | |
async function productReviewsByProductAllGet(request, response) { | |
try { | |
const { productId } = request.params; | |
// get all reviews for a product id | |
const reviews = await productReviewsQuery.selectAllByProductId(productId); | |
const result = []; | |
// Loop from beginning of reviews array to reviews | |
for(let i = 0; i < reviews.length; i++) { |
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
const ProfileImage = () => ( | |
<li> | |
<a> | |
<span class="image"><img src="images/img.jpg" alt="Profile Image" /></span> | |
<span> | |
<span>John Smith</span> | |
<span class="time">3 mins ago</span> | |
</span> | |
<span class="message"> | |
Film festivals used to be do-or-die moments for movie makers. They were where... |
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
function log(input, str) { | |
if (str) return console.log(str, input) | |
console.log('logging', input) | |
return 'Program finished' | |
} | |
// var x = 1; | |
// log(x); | |
// var y = 2; | |
// log(y, 'hihihihihi'); |
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
log('Hi john') | |
// This is a comment! Machines can't read comments. | |
// Comment and uncomment lines by presssing 'Ctrl + /' | |
// There are five primitive types in JavaScript. | |
// Number. Example: 1, 2, 3 | |
// String Example: 'Hi John', 'Dog', 'Cat' |
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
// before | |
<AccountCardInformationFields | |
cardType={cardType} | |
cardForm={cardForm} | |
cardFormErrors={cardFormErrors} | |
cardFieldOnChange={this.cardFieldOnChange} | |
/> | |
// after | |
<AccountCardInformationFields { |
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
// Working with loading indicators | |
// before | |
class PersonRenderer extends Component { | |
render() { | |
if (this.props.person) { | |
return (<div>personcontent</div>) | |
} | |
return <LoadingIndicator/> | |
} | |
} |