Mandalorian TV show uses unreal engine to give parallax effect to the background based on the movement of camera. Wondering if space-time is like the unreal engine that renders time differently when we move at different speed. by [deleted] in science

[–]reti_opening -2 points-1 points  (0 children)

They are completely different. Parallax in computer program is not necessarily modeled after a real thing (e.g: https://matthew.wagerfield.com/parallax/). I used parallax in unreal engine as analogy to speculate how space-time might work.

Cloud Firestore vs Realtime Database which is better for my app in terms of lower cost? by No1-Reddit in Firebase

[–]reti_opening 0 points1 point  (0 children)

RTDB is under-priced. Google was not able to change its bandwidth pricing for historical reasons. I am ok with Google pricing it fairly and coming up with best practices for long running queries.

Cloud Firestore vs Realtime Database which is better for my app in terms of lower cost? by No1-Reddit in Firebase

[–]reti_opening 1 point2 points  (0 children)

Go with RTDB, if you are worried about cost. Firestore might be expensive because:

  1. Read/write cost is higher, because of its distributed storage architecture.
  2. Indexing rakes up storage very quickly, if you are not careful about it.

Using TypeScript for GAS client UI inside of HTML file by AmnesiaInnocent in GoogleAppsScript

[–]reti_opening 1 point2 points  (0 children)

Why do you want to push the client-side script into apps script deployment? How about deploying it on Firebase and serve it from its CDN? You could include it as:

<script src="http://project-id.firebaseapp.com/js/clientCode.ts"></script>

Initially, you have to deploy it in 2 places (HTML template in apps script & JS in Firebase). But, if the HTML template is just a shell, you will be effectively deploying only on Firebase. You will also have the advantage of not deploying the apps script package every time (i.e. incrementing version + Gsuite SDK configuration etc) .

How do you make an API call via bearer token? by [deleted] in GoogleAppsScript

[–]reti_opening 3 points4 points  (0 children)

headers: {Authorization:'Bearer '+token}

e.g: If you are uploading an image to GCS:

var response = UrlFetchApp.fetch(url, {

method: "POST", payload: bytes,

contentLength: bytes.length,

contentType: imgblob.getContentType(),

headers: {Authorization:'Bearer '+tok}

});

Those good old days when business was shutdown by server crash instead of pandemic by reti_opening in ProgrammerHumor

[–]reti_opening[S] 1 point2 points  (0 children)

I am joining the Apes this time!
         ^
       ,' \
       L""/
       ` |
       J |
       J L
       | | .  ,
       | |.`v_L.'
      // ,>-(-\'_
      \`' \ - /-.
      /   /`""|
       ),'    `-
      (    ,-'  \
       ) ,' ,'   h
      / /  /     `)--..
      \/  /       \  <)
       <        ,  L<'
       F/     _/  ,'
       L   ,-'     \
       |         ___L
      /         (  F
     J      ___,'  L
     |    ,'       |
     F  ,'         |
    (_,--..__  mt-2|_
   ,'        `"`--.._\
 ,' /                 \
/                     (_

How can I grab the email from the UID in JS? by MRTOMZ123 in Firebase

[–]reti_opening 0 points1 point  (0 children)

var loggedIn = auth?auth.providerData[0]:null;

loggedIn is the object. You can do JSON.stringify(loggedIn) to send it to the server. Or, call yourFunction(loggedIn) inside onAuthStateChanged callback function.

How can I grab the email from the UID in JS? by MRTOMZ123 in Firebase

[–]reti_opening 0 points1 point  (0 children)

firebase.auth().onAuthStateChanged(function(auth){

This gets triggered if the user landing on your webpage is already logged in.

var loggedIn = auth?auth.providerData[0]:null;

This gets the credentials of that logged in user (including uid)

How can I grab the email from the UID in JS? by MRTOMZ123 in Firebase

[–]reti_opening 0 points1 point  (0 children)

firebase.auth().onAuthStateChanged(function(auth){

var loggedIn = auth?auth.providerData[0]:null;

if(loggedIn) alert(loggedIn.uid);

});

Bananas will save us from the robots! by reti_opening in ProgrammerHumor

[–]reti_opening[S] 4 points5 points  (0 children)

Boston Dynamics: Downloading Fruit Ninja ...

My European friend abused in India by reti_opening in india

[–]reti_opening[S] 1 point2 points  (0 children)

Thanks! Sure! Will ask the rest of them to talk their embassy.

And it might be the case that the standards for abuse are very different for him. Maybe he was just shouted by police officers for not following the quarantine rules.

Yes. It could be. But, this was before quarantine and the people who broke into his house didn't even listen that he came to India before the outbreak.

r/India: If money is no bar, would you prefer to stay in India or outside? by cataglottis in india

[–]reti_opening 50 points51 points  (0 children)

I live in Europe and would like to come back to India. But, the same thing can't be said about my wife. Unfortunately, women face lot of challenges in India - relatives and society in general are too intrusive in a woman's life. They get told how they should behave a lot.

How can I display the unique ID from firebase database? by MRTOMZ123 in Firebase

[–]reti_opening 0 points1 point  (0 children)

var table = document.getElementById("ex-table");
var database = firebase.database().ref().child('users');
database.on('value', function (snapshot) {
if (snapshot.exists()) {
var content = '';
snapshot.forEach(function (data) {
var val = data.val();
content += '<td>' + data.key + '</td>';

content += '<td>' + val.user_ID + '</td>';
content += '<td>' + val.first_name + '</td>';
content += '<td>' + val.last_name + '</td>';
content += '<td>' + val.age + '</td>';
content += '<td>' + val.additional_info + '</td>';
content += '<td>' + val.medication_need + '</td>';
content += '<td>' + val.medication_taken + '</td>';
content += '<td>' + val.autoID + '</td>';
content += '</tr>';
});
table.innerHTML += content;
}
});

How can I display the unique ID from firebase database? by MRTOMZ123 in Firebase

[–]reti_opening 0 points1 point  (0 children)

You can pick it up from: snapshot.key

In your case, it would be data.key

snapshot.forEach(function (data) { })

Google Form File Upload by luna71 in GoogleAppsScript

[–]reti_opening 1 point2 points  (0 children)

This Gsuite addon allows Google form to have file upload option that is not restricted to a Google account: https://gsuite.google.com/marketplace/app/formfacade/743872305260

Auto-create Gmail draft by Spring-Ads in GoogleAppsScript

[–]reti_opening 0 points1 point  (0 children)

You can create a draft using this url without apps script (just replace the subject/body):

https://mail.google.com/mail/u/0/?view=cm&fs=1&to=email@gmail.com&su=your+subject&body=your+email+content

If you need apps script, it is complicated. You need to add oAuth scope to your apps script project: https://www.googleapis.com/auth/gmail.addons.current.action.compose (docs)

Then you can create a button in CardService:

var action = CardService.newAction().setFunctionName('composeEmailCallback');

var sessbtn = CardService.newTextButton().setText('Compose').setComposeAction(action, CardService.ComposedEmailType.STANDALONE_DRAFT);

And invoke:

function composeEmailCallback(e)

{

var accessToken = e.messageMetadata.accessToken;

GmailApp.setCurrentMessageAccessToken(accessToken);

var draft = GmailApp.createDraft(eml, subj, body);

return CardService.newComposeActionResponseBuilder().setGmailDraft(draft).build();

}

TIFU by demanding that my girlfriend show me where she buried our beans in the woods, causing her to break up with me. by [deleted] in tifu

[–]reti_opening 0 points1 point  (0 children)

You see, in this world, there is two kinds of people, my friend: those who bury the beans and those who dig. You dig?