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
.populate([ | |
{path: 'user', select: 'first_name last_name profile_photo'}, | |
{path: 'commentId', populate: {path: 'commentBy', select: 'first_name last_name profile_photo'}} | |
]) |
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
delete all project in heroku | |
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done |
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
file permission to all files inside a directory | |
chmod -R <permissionsettings> <dirname> |
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
Build APK | |
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug | |
cd android/ | |
./gradlew assembleDebug | |
gradlew permission | |
chmod 755 android/gradlew |
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
Delete local branch | |
git branch -d local_branch | |
Delete remote branch | |
git push origin --delete remote_branch | |
change git url | |
git remote set-url origin git://new.url.here |
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
await stripe.tokens.create({ | |
card: { | |
"number": '4242424242424242', | |
"exp_month": 12, | |
"exp_year": 2018, | |
"cvc": '123' | |
} | |
}, function(err, token) { | |
stripe.customers.create({ | |
email: '[email protected]' |
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
v-validate="{ rules: { required: true, regex: /\b(0[1-9]|1[0-2])\/?([0-9]{4}|[0-9]{2})\b/} }" //inline regex | |
custom: | |
this.$validator.extend('emailexists', { // checks if the email is already in db | |
getMessage: field => 'Your email is in our record.Please check your email to login', | |
validate: async value => { | |
let response = await fetch(`${process.env.baseUrl}/users/auth/searchbyquery?email=${value}`, { | |
method: 'GET', | |
headers: {'Content-Type': 'Application/json'} | |
}) | |
let result = await response.json() |
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
//radius calculation | |
switch(radius_unit) | |
{ | |
case "Meters": { input_value = meters; break;} | |
case "KM": { input_value = meters/1000; break;} | |
case "Feet": { input_value = meters*3.28084; break;} | |
case "Miles": { input_value = meters*0.000621371; break;} | |
default : | |
{ |
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
//radius calculation | |
switch(radius_unit) | |
{ | |
case "Meters": { input_value = meters; break;} | |
case "KM": { input_value = meters/1000; break;} | |
case "Feet": { input_value = meters*3.28084; break;} | |
case "Miles": { input_value = meters*0.000621371; break;} | |
default : | |
{ |
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
modal | |
v-bind:class="{ modal: true, 'is-active': processing }" |
NewerOlder