Let's make sure our Express app has the required base modules:
# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon| # This to be used when you need to implement SSL | |
| # Make sure that apache mod_ssl is on | |
| # You can generate self signed certificates for development | |
| # http://www.selfsignedcertificate.com/ | |
| <VirtualHost *:443> | |
| ServerName yourapp.test | |
| #ServerAlias www.yourapp.test |
| //prevents listening from other domains pointed to our IP | |
| server { | |
| listen 80 default_server; | |
| server_name _; | |
| return 404; | |
| } | |
| server { | |
| server_name paavam.com; | |
| /* | |
| Group 14 (50,52,54,56) | |
| Create a class to hold a point containing member variable to store x and y co-ordinates. Add | |
| necessary member functions to initialize, set and to get values. | |
| Create a class to represent rectangle that contains member variables to hold two instances of point | |
| (top left and bottom right point).Add necessary member function to handle rectangle instance. | |
| Implement a main() to create as many instances of rectangle as per user’s choice dynamically. | |
| Then calculate the perimeter of those rectangles. |
| public class MyFirebaseMessagingService extends FirebaseMessagingService { | |
| private static final String TAG = MyFirebaseMessagingService.class.getSimpleName(); | |
| @Override | |
| public void onNewToken(String token) { | |
| Log.d(TAG, "Refreshed token: " + token); | |
| } | |
| @Override | |
| public void onMessageReceived(RemoteMessage remoteMessage) { |
| def doBalance(expression): | |
| stack = [] | |
| if(len(expression)%2!=0 or expression[0]==")" or expression[-1] == "("): | |
| return False | |
| for ex in expression: | |
| if(ex == "("): | |
| stack.append(1) | |
| else: | |
| stack.pop() |
| int resID = mContext.getResources().getIdentifier(category.getFile_name(), "drawable", mContext.getPackageName()); | |
| // create file from drawable image | |
| Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(), resID); | |
| File filesDir = mContext.getFilesDir(); | |
| File imageFile = new File(filesDir, category.getFile_name() + ".jpeg"); | |
| OutputStream os; | |
| try { |
| # Web streaming example | |
| # Source code from the official PiCamera package | |
| # http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming | |
| import io | |
| import picamera | |
| import logging | |
| import socketserver | |
| from threading import Condition | |
| from http import server |
| { | |
| "statuses": [ | |
| { | |
| "created_at": "Mon May 06 20:01:29 +0000 2019", | |
| "id": 1125490788736032770, | |
| "id_str": "1125490788736032770", | |
| "text": "Today's new update means that you can finally add Pizza Cat to your Retweet with comments! Learn more about this ne… https://t.co/Rbc9TF2s5X", | |
| "truncated": true, | |
| "entities": { | |
| "hashtags": [], |