Skip to content

Instantly share code, notes, and snippets.

View JaiParakh's full-sized avatar
🏠
Working from home

Jai Parakh JaiParakh

🏠
Working from home
View GitHub Profile
void checkAllSmells()
{
// Fetches all smell sources in the scene.
SmellSource[] all_smells = FindObjectsOfType<SmellSource>();
// We can multiple smell sources in our game
foreach (SmellSource smell in all_smells)
{
// We calculate the intensity of the smell here
float intensity = smell.getSmellIntensityAt(transform.position);
using UnityEngine;
public class SmellSource : MonoBehaviour
{
// Here you can add your smell types
public enum SmellType { Treasure }
// Set a default type
public SmellType smellType = SmellType.Treasure;
let event = new Event(auth);
event.addEvent('Summary','Description','2020-03-16T11:00:00','2020-03-18T11:00:00');
import React, { createRef } from "react";
import { StyleSheet, Text, View, Button } from 'react-native';
import ActionSheet from "react-native-actions-sheet";
const actionSheetRef = createRef();
// This Menu component is fully customizable. Add whatever you want!!
const Menu = () => (
<View style={styles.drawerContent} >
<Text>Hello There</Text>
@JaiParakh
JaiParakh / App.js
Last active December 21, 2020 08:35
import React, { useState, useEffect } from 'react';
import { View, Text, Button, StatusBar } from 'react-native';
import auth from '@react-native-firebase/auth';
import { GoogleSignin } from '@react-native-community/google-signin';
GoogleSignin.configure({
webClientId: '',
});
const {google} = require('googleapis');
var base64 = require('js-base64').Base64;
const parse = require('node-html-parser').parse;
const cheerio = require('cheerio');
var open = require('open');
var Mailparser = require('mailparser').MailParser;
class Check{
constructor(auth){
const {google} = require('googleapis');
class Event {
//This auth object should be passed whenever a new instance of class is created in order to authenticate the requests.
constructor(auth){
this.auth = auth;
this.calendar = google.calendar({version: 'v3', auth});
}
const fs = require('fs');
const readline = require('readline');
const {google} = require('googleapis');
// If modifying these scopes, delete token.json.
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly','https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.compose','https://www.googleapis.com/auth/gmail.send'];
// The file token.json stores the user's access and refresh tokens, and is
// created automatically when the authorization flow completes for the first
// time.
import sys
import json
x = {
"sum": int(sys.argv[1]) + int(sys.argv[2])
}
print(json.dumps(x))
//We will have to create a childprocess in order tocall python script.
var spawn = require("child_process").spawn;
//This process is called here.
var process = spawn('python',["./add.py",7,3] );
//We listen for 'data' event.
process.stdout.on('data', function (data) {
console.log("Sum " + JSON.parse(data.toString()).sum);
});