Author: 13l50qfydqlo

  • fb-messenger-bot

    Guidelines to create your bot - Facebook Workplace

    Node.js website Npm website ExpressJS website Facebook Messenger
    GitHub release (latest by date) Travis (.org) GitHub

    💬 Note from developer

    This application is a starter for the creation of bots for Facebook Messenger and WorkChat (Workplace) for demonstration and education purposes. Its configuration is robust and scalable and can be used in a productive environment. Use this application to learn, experiment, retouch and practice the different options offered by the Facebook API.

    For more information about the Facebook API you can read the documentation that the Messenger team prepared.


    Glossary

    🤔 How does the Messenger platform work?

    Messaging bots use a web server to process the messages they receive or to find out which messages to send. It is also necessary for the bot to be authenticated to talk to the web server and for the bot to be approved by Facebook to talk to the public.

    When a person sends a message to a company in Messenger, the following happens, as long as the page uses an app to partially or completely automate the conversations. The Facebook server sends webhooks to the URL of the company’s server where the message app is hosted. That app can then reply to the person in Messenger using the Send API. This allows developers to create guided conversations for people to perform an automated process or develop an app that serves as a link between your agents and your company’s Messenger presence.

    Workflow API Messenger

    🤖 Live Demo

    You can try some functions of the bot by entering here.

    Live Demo

    And you can try other kind of messages from the server documentation, don’t forget to get your ID from the chat bot persistent menu.

    🙌 Let’s start

    Before starting to work on our bot, we must have installed some tools in our computer that will facilitate us to work locally and be able to test some functionalities that the starter has available, and I will take for granted some basic concepts so as not to go into detail and extend the documentation.

    📝 Basic requirements

    🛠 Install dependencies

    When we have the basic requirements, we clone the repository, go to the project folder and install its dependencies.

     npm install
    

    We download the latest version of Ngrok compatible with our operating system, and decompress it in the server root.

    ⚙ Configurations

    This application uses the config dependency to facilitate the configuration of environment variables, which makes it scalable and robust when deploying the application in different environments.

    In the path ./config you will find a file called development.json which contains the settings for a local environment, while the file custom-environment-variables.json gets the key values of the environment variables displayed on the server.

    Basically the file works as an object that is exported and can be consumed by invoking it in the file that requires consuming the loaded information. If you need to add another type of data to consume, like the connection to a database, the url of some microservice, etc. you just have to add it to both files keeping the scheme.

    You may find that you can’t configure some values for now, but that’s not a problem, when using the nodemon dependency, the server is in a watching state that at the slightest change of code, the server will run again.

    {
      server: {
        url: '',
        port: 8080,
        context: '/api',
        origins: 'http://localhost:3000,http://localhost:3001,http://localhost:8080',
        originsReadOnly: 'http://localhost:3001',
        corsEnabled: 'false',
        tz: 'America/Argentina/Buenos_Aires',
        showLogInterceptor: 'false',
      },
      params: {
        fbApiVersion: 'v8.0',
        verifyToken: 'my_awesome_bot_verify_token',
        appSecret: '',
        accessToken: '',
        subscribedFields: 'messages,messaging_postbacks',
        userFields: 'id,name,first_name,last_name,email',
        secrets: '',
        requireProof: false
      },
      services: {
        fbApiUrl: 'https://graph.facebook.com',
      },
      swagger: {
        enabled: 'true',
      },
    }
    See all available configuration properties in detail.

    Server

    url: It is the url of the server deployed in some environment, in the case of running it locally, you enter the url with ssl provided by ngrok.

    • Type: String
    • Default:

    port: Is the port in which the application is deployed.

    • Type: Number
    • Default: 8080

    context: It is the context from which the server’s api can be accessed, this way the routes in the main path of the application are not exposed.

    • Type: String
    • Default: /api

    origins: The origins serve so that the application can only be consumed by reliable urls and avoid any kind of unwanted and malicious requests. You should write the urls separated with comma.

    • Type: String
    • Default: http://localhost:3000,http://localhost:3001,http://localhost:8080

    originsReadOnly: It is the configuration of the urls for CORS, which allows you to validate who can consume the server.

    • Type: String
    • Default: http://localhost:3001

    corsEnabled: Enables or disables the use of CORS on the bot’s server.

    • Type: Boolean
    • Default: false

    tz: It is the configuration of the time zone. List of time zones

    • Type: String
    • Default: America/Argentina/Buenos_Aires

    showLogInterceptor: Enables the display of the request interceptors in the logs.

    • Type: Boolean
    • Default: false

    Params

    fbApiVersion: Is the api version of facebook

    • Type: String
    • Default: v8.0

    verifyToken: It is the verification token required by the application when invoked by facebook, this token is private and should not be exposed.

    • Type: String
    • Default: my_awesome_bot_verify_token

    appSecret: It is the secret key to the app, it is required if you are going to use the security settings for the requests.

    • Type: String
    • Default:

    accessToken: The access token is the alphanumeric hash that is generated when you create the application on Fecebook or Workplace.

    • Type: String
    • Default:

    subscribedFields: Are the permissions required to subscribe to the application in order to interact with the user. These permissions are only required for Facebook bots and must be typed separately by comma.

    • Type: String
    • Default: messages,messaging_postbacks,messaging_optins

    userFields: It is a comma-separated list to obtain the user’s information.Documentation

    • Type: String
    • Default: id,name,first_name,last_name,email

    secrets: Here you can enter any value you want to hide in the server logs of the bot, for example the id of the sender or the id of the sender. The values to hide must be written separated by comma.

    • Type: String
    • Default:

    requireProof: Enables or disables the use of appsecret_proof and appsecret_time for security requests, it is required to have configured the secret key of the app to work.

    • Type: Boolean
    • Default: false

    services

    fbApiUrl: It is the url of the Graph API of Feacebook

    • Type: String
    • Default: https://graph.facebook.com

    swagger

    enabled: Enable or disable the documentation of the bot’s server endpoints with swagger.

    • Type: Boolean
    • Default: true

    💻 Run server

    We start the bot’s server.

    npm run start
    

    Server Bot running in terminal

    Once the server is started, we must start ngrok to create the connection tunnel between the bot’s local server and the Facebook server.

    ./ngrok http 8080
    
    Windows
    ./ngrok.exe http 8080
    

    Server ngrok in terminal

    To see other tunnel configurations, you can check the documentation

    📚 Swagger

    The project has a Swagger that has documented the most important endpoints of the project, and facilitates the configuration of the fields for the bot, such as the get started button, persistent menu and the greeting.

    This documentation can be enabled or disabled from the configuration files.

    • Default: http://localhost:8080/api-docs

    URL Scheme

    <http|https>://<server_url><:port>/api-docs
    

    🖥️ Deploy server in heroku (free)

    You can run the bot server in a productive environment on any node server, in this case I will explain the steps to raise the server on the platform Heroku, which has a free version to deploy node servers, you can also hire a paid service which gives you more features.

    💬 If you don’t have a Heroku account, you can create one by going to https://signup.heroku.com/.

    We will need a file called Procfile, which is the one Heroku will use to initialize the server once deployed.

    Its content is:

    web: npm start
    
    1. After logging into Heroku, click on Create new app

    Create a new app in heroku 1

    1. We write the name of our app, and select a region, and then click on Create App.

      💬 note: Remember to save the name of the app, as you will need it later to replace the value of <app_name> with the name of the app.

    Create a new app in heroku 2

    1. Heroku gives you several options to deploy your server. You can do it with Heroku CLI by following the steps in the documentation, or you can deploy it directly from Github, which is much easier.

    Create a new app in heroku 3

    Deployment method: Heroku CLI

    Download and install the Heroku CLI.

    If you haven’t already, log in to your Heroku account and follow the prompts to create a new SSH public key.

    heroku login
    
    Create a new Git repository

    Initialize a git repository in a new or existing directory

    cd my-project/
    git init
    heroku git:remote -a <app_name>
    
    Deploy your application

    Commit your code to the repository and deploy it to Heroku using Git.

    git add .
    git commit -am "make it better"
    git push heroku master
    
    Deploy your application

    For existing repositories, simply add the heroku remote

    heroku git:remote -a <app_name>
    

    Deployment method: GitHub

    We click on the connect to GitHub button, if you’ve never connected Heroku to Github, a window will open to authorize the connection so you can continue with the step of entering the name of the repository and searching it in your GitHub account, and once you find it, we click on the Connect button.

    Create a new app in heroku 4

    Then we select the branch we want to deploy, and click on Deploy Branch, and it will start running the deployment, downloading the code from the repository, installing the dependencies, etc.

    Create a new app in heroku 5

    1. Now we have to configure the environment variables of the server, although we can do it manually from Settings > Config Vars, there is a bash script prepared that will raise the environment variables of our .env file that is located in the ./variables folder.
    npm run heroku:envs
    

    or

    bash heroku-envs.sh
    

    Create a new app in heroku 6

    📱 Setup the Facebook App

    The time has come to create and configure our app on Facebook.

    With the local server and the connection tunnel initialized, we will configure the app, and with the information that it will give us we will finish configuring the data that we are missing in the bot’s server.

    💬 Remember that the bot’s server is in watch mode, and any changes made will be re-initialized and take the changes made.

    1. Enter Facebook Developers and click on create app, it will open a modal to select the type of application, in our case we will create an application type “Manage business integrations“.

    Create a new app on facebook

    1. Now we will have to make some basic settings for the application.

      We assign a name of the app to identify it, we put a contact email, we select the purpose of the app, in this case is for us, and if we have a commercial administrator account, we select one from the list, if you do not have such an account, you can create it later.

      Once the information is completed, we click on Create App identifier

      Basic settings new app on facebook

    2. Then we look for Messenger in the app’s product list, and hit the configure button.

    Settings new app on facebook 1

    1. Now we are going to make the two necessary and essential configurations to be able to connect Facebook with our bot server.

      Settings new app on facebook 2

      Access tokens

      In this part of the configuration, we will be able to manage which page or pages of facebook will have the bot available. We click on Add or Remove pages, and select the page.

      Settings new app on facebook 3

      Once the page is linked to the app, we have to generate the token by clicking on the button Generate Token, and a window will open where you give us some instructions about the token.

      We must check accept in order to view the full hash, then copy it and place it in the configuration of our server, if it is for development it is put in the json of ./config/development.json in the key of accessToken, and if it is for a productive environment, we must put it in the envs file in ./variables.

      Settings new app on facebook 4

      {
        ...
        params: {
          ...
          accessToken: '<access_token>',
          ...
        },
       ...
      }

      Webhooks

      Now we have to configure the connection between Facebook and our server through Webhook, for this, you must have at hand the verifyToken that you configured and the bot’s server url, in this case, we will use the one provided by ngrok with ssl.

      https://<id_tunnel>.ngrok.io/api/webhook/
      

      Settings new app on facebook 5

      Then click on Verify and Save, and if everything goes well, in the server terminal you should see the successful subscription message.

      Config webhook subscription response terminal

      If the url of the webhook by ngrok changes, or you want to configure the url of the productive server, you can do it by clicking on the button Edit Callback URL and perform again the previous steps.

      Add subscriptions

      Now we have to add the subscriptions that will allow the bot to have certain permissions to perform the actions we need.

      For that we click on the button Add subscriptions

      Settings new app on facebook 6

      Select from the list the basic permissions and click on Save

      Then we add each permission to the configuration files separated by a comma.

      Settings new app on facebook 7

      {
        ...
        params: {
          ...
          subscribedFields: 'messages,messaging_postbacks,messaging_optins',
          ...
        },
        ...
      }
    2. These are the last settings to be made and are optional. It consists in executing a curl script in the terminal to implement some options, don’t forget to put the access token to make it work.

      💬 Note: You can run these scripts from Swagger, but you must adjust the files that are inside the ./templates/configs folder

      Add button Get Started

      curl -X POST -H "Content-Type: application/json" -d '{
           "get_started": {
               "payload": "GET_STARTED_PAYLOAD"
           }
      }' "https://graph.facebook.com/v8.0/me/messenger_profile?access_token=<access_token>"

      Add greeting

      curl -X POST -H "Content-Type: application/json" -d '{
      "greeting": [
           {
               "locale": "default",
               "text": "Hi {{user_first_name}}, i'm a bot!"
           }
      ]
      }' "https://graph.facebook.com/v8.0/me/messenger_profile?access_token=<access_token>"

      Add persistent menu

      curl -X POST -H "Content-Type: application/json" -d '{
         "persistent_menu":[
            {
               "locale":"default",
               "composer_input_disabled":false,
               "call_to_actions":[
                  {
                     "title":"About us",
                     "type":"postback",
                     "payload":"ABOUT_US_PAYLOAD"
                  },
                  {
                     "title":"Contact",
                     "type":"postback",
                     "payload":"CONTACT_PAYLOAD"
                  },
                  {
                     "type":"web_url",
                     "title":"💻 Visit my Website",
                     "url":"http://misite.com/",
                     "webview_height_ratio":"full"
                  }
               ]
            }
         ]
      }' "https://graph.facebook.com/v8.0/me/messenger_profile?access_token=<access_token>"

      Remove persistent menu

      curl -X DELETE -H "Content-Type: application/json" -d '{
          "fields":[
               "persistent_menu"
          ]
      }' "https://graph.facebook.com/v8.0/me/messenger_profile?access_token=<access_token>"

    🙌 End of configuration

    We have finished configuring the app so that Facebook connects to the bot’s server, now we have to test it, to do this we can enter the chat page and perform a test to verify that everything is working properly.

    📡 How to share your bot

    Add a chat button to your webpage, go here to learn how to add a chat button your page.

    🔗 Create a shortlink

    You can use page username to have someone start a chat.

    https://m.me/<PAGE_USERNAME>
    

    📱 Setup the Workplace App

    The configuration of the app for Workplace is quite similar to that of Facebook, it is required to have the Workplace paid account in order to enable custom integrations.

    1. Go to the Administrator Panel, and click on the Integrations button, and in the Custom integrations section click on the Create custom integration button.

      It will open a modal where we must write the name of the application and a description, then click on Create.

      Settings new app on workplace 1

    2. Once the application is created, it takes us to the configuration page of the application.

      Settings new app on workplace 2

      Access token

      Now we are going to generate an access token and then configure it in our config, as mentioned in the configuration of the Facebook app.

      Settings new app on workplace 3

    3. Now let’s select the permissions for our bot.

      Permissions

      In our case we are interested in the option of Sending a message to any member.

      Settings new app on workplace 4

    4. Now we are going to grant the integration access to groups, in this case it is going to be to a specific group.

    Settings new app on workplace 5

    1. And finally, we have to configure the Webhook and the verify token and select the subscriptions we need, as we did with the Facebook app.

      Settings new app on workplace 6

      💬 Note: depending on the webhook configuration you select in the tabs, the subscriptions will change.

    2. 🙌 Finally we click on the save button.

      💬 Note: there is an optional configuration which is the security one, where it is required to enter the ip of the bot’s server, the domain, etc.

      Settings new app on workplace 7

    🔐 Security Configuration

    To give more security to the application, both for Facebook and Workplace, it is important to have completed the environment variable appSecret and have set true the requireProof for the bot to work properly with these new settings.

    {
      ...
      "params": {
        "appSecret": "<app_secret_key>",
        ...    
        "requireProof": true
      }
      ...
    }

    For both cases, it is required to have the public IP of the server, since that way, it will only be limited to receive and send requests from a single authorized server.

    If you have more than one public IP, or another server to balance the bot’s requests, you can add it to the list.

    Facebook App

    In the configuration of the app, we go to the left side menu and go to Settings > Advanced, and then down to the Security section, where we will enter our public IP, and then we will activate the option Require secret key of the app.

    Settings new app on facebook 8

    Workplace App

    In the configuration of the app, we go down to the Security Settings section, where we will activate the option to require a secret key test of the app, and then we will enter our public IP.

    Settings new app on workplace 8

    🤦‍♂️Troubleshooting

    Workplace App

    ❌ (#200) To subscribe to the messages field

    (#200) To subscribe to the messages field, one of these permissions is needed: pages_messaging. To subscribe to the messaging_postbacks field, one of these permissions is needed: pages_messaging

    You can solve this problem by configuring the webhook without selecting the subscriptions, then saving the configuration, then re-entering the app configuration and re-validating the webhook with the selected subscriptions.

    💡 Contributing

    Requests are welcome. For important changes, please open a topic first to discuss what you would like to change.

    Please be sure to update the tests and documentation as appropriate.

    👨‍💻 Author

    badge

    📜 License MIT

    Visit original content creator repository https://github.com/rudemex/fb-messenger-bot
  • fda-510k

    Streamlit Weblink

    FDA 510k Knowledge Base Project

    Description

    This project is a Streamlit-based web application that leverages a Large Language Model (LLM) with Retrieval-Augmented Generation (RAG) capabilities, powered by Snowflake. The application serves as a knowledge base for FDA 510k submissions, allowing users to chat with an AI assistant and generate submission reports.
    Features

    Chat interface for querying about FDA medical device submissions
    Report generator for creating detailed FDA 510(k) submission reports
    Integration with Snowflake for data storage and retrieval
    Utilization of LLM-RAG for enhanced query responses

    Installation

    Clone the repository:
    Copygit clone https://github.com/your-username/fda-510k-knowledge-base.git
    cd fda-510k-knowledge-base

    Install the required dependencies:
    Copypip install -r requirements.txt

    Set up your Snowflake connection:

    Ensure you have a Snowflake account and the necessary credentials
    Configure your Snowflake connection in the Streamlit secrets management.
    /!\ Unfortunately RAG vector database is hosted in my snowflake account, so this project can not be runned without my credentials.

    Usage

    Run the Streamlit app:
    Copystreamlit run streamlit_app.py

    Open your web browser and navigate to the provided local URL (usually http://localhost:8501)
    Use the chat interface to ask questions about FDA 510k submissions
    Generate submission reports using the provided form in the “Generate Report” tab

    Project Structure

    streamlit_app.py: Main application file containing the Streamlit interface
    helper.py: Contains helper functions for LLM interactions and report generation
    requirements.txt: List of Python dependencies
    assets/: Directory containing additional resources (e.g., images, documents)

    Dependencies

    Streamlit
    Snowflake Snowpark
    Pandas
    Other dependencies as listed in requirements.txt

    Configuration

    Snowflake connection: Configure in Streamlit’s secrets management
    Model selection: Available in the sidebar of the application
    Debug mode: Toggle in the sidebar for additional information

    Notes

    This application uses vectorized PDF documents as a knowledge base
    The LLM-RAG system is built on top of Snowflake’s infrastructure
    Ensure proper handling of sensitive information in FDA submissions

    ##License
    This project is licensed under the MIT License.

    Visit original content creator repository
    https://github.com/arnaud-dg/fda-510k

  • starboard

    Turborepo starter

    This is an official starter Turborepo.

    Using this example

    Run the following command:

    npx create-turbo@latest

    What’s inside?

    This Turborepo includes the following packages/apps:

    Apps and Packages

    • docs: a Next.js app
    • web: another Next.js app
    • ui: a stub React component library shared by both web and docs applications
    • eslint-config-custom: eslint configurations (includes eslint-config-next and eslint-config-prettier)
    • tsconfig: tsconfig.jsons used throughout the monorepo

    Each package/app is 100% TypeScript.

    Utilities

    This Turborepo has some additional tools already setup for you:

    Build

    To build all apps and packages, run the following command:

    cd my-turborepo
    pnpm build
    

    Develop

    To develop all apps and packages, run the following command:

    cd my-turborepo
    pnpm dev
    

    Remote Caching

    Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

    By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don’t have an account you can create one, then enter the following commands:

    cd my-turborepo
    npx turbo login
    

    This will authenticate the Turborepo CLI with your Vercel account.

    Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

    npx turbo link
    

    Useful Links

    Learn more about the power of Turborepo:

    Visit original content creator repository
    https://github.com/robere2/starboard

  • border-radius-for-us

    border-radius-for-us

    Build Status GitHub GitHub repo size

    border-radius project in browser looks like

    Displays the border-radius property that CSS uses when a user creates a border. You can only change a specific side or all at once, then copy what you’ve done and paste into your code.

    Try It Out!

    Trello Project Board

    Application functionality

    • User sees the created border-radius and can adjust its position.
    • User can only correct a specific side or all at once.
    • User can copy the result.

    Additional functionality

    • User can select a specific browser prefix.
    • User can go and see the documentation for this property.

    Used technologies and libraries

    • React
    • TypeScript
    • CSS Modules
    • create-react-app

    Available Scripts

    In the project directory, you can run:

    yarn start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in the browser.

    The page will reload if you make edits.
    You will also see any lint errors in the console.

    yarn test

    Launches the test runner in the interactive watch mode.
    See the section about running tests for more information.

    yarn build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    yarn eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

    Visit original content creator repository https://github.com/s0xzwasd/border-radius-for-us
  • Best-seller-book-using-React-vite

    Best Seller Book Repository

    This repository contains a web application built using React.js and Vite. The application is designed to showcase best-selling books. Users can browse through a curated list of books, view details about each book, and interact with the application seamlessly.

    Features

    • Browse a curated list of best-selling books.
    • View details about each book, including title, author, description, and rating.
    • Search functionality to find specific books.
    • Responsive design for optimal viewing on various devices.
    • Fast and efficient performance using Vite for development and production builds.

    Technologies Used

    • React.js
    • Vite
    • JavaScript (ES6+)
    • HTML5
    • CSS3

    Getting Started

    To get a local copy of the project up and running, follow these steps:

    1. Clone the repository to your local machine:
    git clone https://github.com/your-username/best-seller-book.git
    
    1. Navigate into the project directory:
    cd best-seller-book
    
    1. Install the dependencies:
    npm install
    
    1. Start the development server:
    npm run dev
    
    1. Open your web browser and visit http://localhost:3000 to view the application.

    Usage

    • Upon launching the application, you’ll be presented with a list of best-selling books.
    • Use the search bar to find specific books by title or author.
    • Click on any book to view detailed information about it.

    Contributing

    Contributions are welcome! If you’d like to contribute to this project, please follow these steps:

    1. Fork the repository.
    2. Create a new branch (git checkout -b feature/your-feature-name).
    3. Make your changes.
    4. Commit your changes (git commit -am 'Add some feature').
    5. Push to the branch (git push origin feature/your-feature-name).
    6. Create a new Pull Request.

    License

    This project is licensed under the MIT License – see the LICENSE file for details.

    Acknowledgements

    • This project was created as a demonstration of using React.js and Vite for building web applications.
    • Special thanks to the creators and maintainers of React.js and Vite for providing excellent tools for web development.

    Visit original content creator repository
    https://github.com/VijayMakkad/Best-seller-book-using-React-vite

  • GOST-28147-89

    GOST 28147-89 Verilog HDL code

    Description

    This is a implementation of the GOST 28147-89 – a Soviet and Russian government standard symmetric key block cipher (now as part of standard GOST R 34.12-2015).
    GOST 28147-89 has a 64-bit blocksize and 256-bit keysize.

    Note
    Russian description available here: http://idoka.ru/crypto-ip-core-gost-28147-89/

    This implementation provide trade off size and performance. The goal was to be able to fit in to a low cost Xilinx Spartan series FPGA and still be as fast as possible. As one can see from the implementation results below, this goal has been achieved.

    Short Chipher Detail

    Date published

    1989

    Structure

    Feistel network

    Key sizes

    256 bits

    Block sizes

    64 bits

    Rounds

    32

    Features

    • SystemVerilog RTL and TB code is provided

    • Implements both encryption and decryption in the same block

    • GOST 28147-89 algorithm focusing on very low area applications

    • Implementation takes about 32 cycles to encrypt/decrypt a block

    • EBC-cipher mode support

    • Now support following set of S-boxes (names on accordence with RFC4357)

      • id-GostR3411-94-TestParamSet

      • id-Gost28147-89-CryptoPro-A-ParamSet

      • id-Gost28147-89-CryptoPro-B-ParamSet

      • id-Gost28147-89-CryptoPro-C-ParamSet

      • id-Gost28147-89-CryptoPro-D-ParamSet

      • id-tc26-gost-28147-param-Z

      • additional R34.11-94 CryptoPro S-box supported

    Status

    • Core implementations have been tested on a Xilinx Spartan-3E FPGA succesfully

    Employment

    For run synthesize design using Synplify tool use command:

    $ make synthesis

    To compile and run simulation RTL-design using ModelSim with CLI:

    $ make sim

    To compile and run simulation RTL-design using ModelSim with GUI:

    $ make sim-gui

    In order to determine which S-box will be used for synthesis/simulation you must to pass apropriate define by command line argument:

    • GOST_SBOX_TESTPARAM – for id-GostR3411-94-TestParamSet S-box using

    • GOST_SBOX_CRYPTOPRO_A – for id-Gost28147-89-CryptoPro-A-ParamSet S-box using

    • GOST_SBOX_CRYPTOPRO_B – for id-Gost28147-89-CryptoPro-B-ParamSet S-box using

    • GOST_SBOX_CRYPTOPRO_C – for id-Gost28147-89-CryptoPro-C-ParamSet S-box using

    • GOST_SBOX_CRYPTOPRO_D – for id-Gost28147-89-CryptoPro-D-ParamSet S-box using

    • GOST_SBOX_TC26_Z – for id-tc26-gost-28147-param-Z S-box using

    • GOST_SBOX_R3411 – for GOST R34.11-94 CryptoPro S-box using

    All procedures like synthesis or simulation was tested on the Linux environment (x86_64 host).

    Synthesis

    Sample Synthesis Results for the ECB-mode GOST 28147-89

    Technology 	       Size/Area 	Speed/Performance
    ==============================================================
    Xilinx Spartan-3E      525 LUTs         75 Mhz (150 Mbits/sec)

    Limitations

    The design uses SystemVerilog as language for RTL-implementation therefore your Design Tools should support SystemVerilog for synthesis and simulation.

    References

    Feel free to send me comments, suggestions and bug reports

    Visit original content creator repository
    https://github.com/iDoka/GOST-28147-89

  • react-padding

    MDB Logo

    MDB React 5

    Responsive React Padding styles and classes for Bootstrap 5. Examples of padding left, right, top, bottom, between columns and rows, grid padding, RTL support & more.

    Before reading this helper page make sure that you have checked out the main documentation pages for Gutters – padding between your columns, used to responsively space and align content in the Bootstrap grid system. Spacing – shorthand responsive margin and padding utility classes to modify an element’s appearance. The links above contain more comprehensive and structured explanations of padding & margin use in Bootstrap 5, this helper page will only provide you with quick examples.

    Check out React Padding Documentation for detailed instructions & even more examples.

    Padding classes

    Add padding values to an element or a subset of its sides using shortcode classes. Individual top, bottom, left, right as well as horizontal, vertical and “add to all sides” properties are supported. Classes range from .25rem to 3rem and are based on the default Sass map.

    MDB supports RTL, so for example, for the padding on the right: you have to use the class pe-* (padding end) instead of pr-* (padding right). Thanks to this notation, your padding will be inverted for users with right-to-left setting enabled. You can learn more about Right to Left support in our RTL docs.

    Below is an example using classes for the right padding (padding at the end) with a visual representation of their sizes. The same sizes apply to all directions (left, right, top, bottom).

    React Padding

    How to use?

    1. Download MDB 5 – FREE REACT UI KIT

    2. Choose your favourite customized component and click on the image

    3. Copy & paste the code into your MDB project

    ▶️ Subscribe to YouTube channel for web development tutorials & resources


    More extended React documentation

    Visit original content creator repository https://github.com/mdbootstrap/react-padding
  • yuhdolanpwt

    Laravel Logo

    Build Status Total Downloads Latest Stable Version License

    About Laravel

    Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

    Laravel is accessible, powerful, and provides tools required for large, robust applications.

    Learning Laravel

    Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

    You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

    If you don’t feel like reading, Laracasts can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

    Laravel Sponsors

    We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

    Premium Partners

    Contributing

    Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

    Code of Conduct

    In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

    Security Vulnerabilities

    If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

    License

    The Laravel framework is open-sourced software licensed under the MIT license.

    Visit original content creator repository https://github.com/hilmyha/yuhdolanpwt
  • riverdi-101-stm32h7-lvgl

    LVGL port for the 10.1-inch Riverdi STM32 Embedded Displays (STM32H757XIH6)

    This repository contains the Light and Versatile Graphics Library (LVGL) port for the 10.1-inch Riverdi STM32 Embedded Displays with STM32H757XIH6 MCU. It’s ready-to-use project template which you can easily import into STM32CubeIDE and STM32CubeMX (to reconfigure selected peripherals). This project uses latest stable LVGL release (v8.3 branch). For more info about LVGL (docs, API, tutorials) please visit https://lvgl.io/ and https://github.com/lvgl/lvgl

    img1

    This repository supports all configuration of 10.1-inch Riverdi STM32 Embedded Displays:

    For LVGL project templates for 5-inch and 7-inch Riverdi STM32 Embedded Displays, please visit:

    What is Riverdi STM32 Embedded Display?

    Riverdi’s Display STM32 Embedded product series are a comprehensive solution for a variety of applications. With high resolution, high brightness, and a host of features, these displays are designed to meet the most demanding requirements.

    Riverdi offers a variety of STM32 touch screen displays, including a brand new 5-inch STM32 display modules in its top-tier embedded screen solutions. With the STM32 7-inch LCD and 10.1-inch STM32 TFT display already on the market, the Riverdi LCD Display STM32 Embedded series is the all-in-one HMI solution well-suited for the most demanding applications.

    The STM32 Embedded Displays are not just a product, they are an ecosystem based on the industrial-quality LCD-TFT displays with high-brightness, high-resolution, and industrial touchscreen, the performance and interfaces offered by the STM32 microcontrollers, and the comprehensive technical support with free software and libraries.

    10.1-inch Riverdi STM32 Embedded Display

    Main features of the 10.1-inch Riverdi STM32 Embedded Display:

    • 10.1-inch TFT display
    • 1280x800px resolution
    • High brightness 850cd/m2
    • Full viewing angles (IPS)
    • STM32H757XIH6 (2MB Flash, 1MB RAM) microcontroller
    • All STM32H7 interfaces
    • Optical bonding
    • Industrial projected capacitive touch screen
    • Black decorative cover glass
    • High quality – zero bad pixels
    • 64MB QSPI
    • 8MB SDRAM
    • TouchGFX and LVGL direct support
    • Power Supply: 6V-48V

    img2

    • RS485
    • RS232
    • Expansion connector – the board offers additional and independent GPIOs over a 40pin, 1.27mm male header. It provides direct access to the GPIOs of MCU STM32, that makes it possible to be easily extended by an addon board for specific application (2x I2C, 1x UART, 1x USART, 1x SPI, 1x USB, 7x PWMs, 2x DACs, 2x ADCs)
    • Fully independent 2x CAN FD – applicable in industrial and automotive area
    • Fast-programming SWD port – SWD connector allows to program STM32 and QSPI with customer’s applications. Riverdi developed the ST-LINK programming cable that is included in the STM32 Embedded Display sample package (single packing)
    • RiBUS connector – in some applications there might be a need to connect a second display in one device. With the STM32 Embedded Display line it is very easy as these displays are equipped with Master RiBUS connector – universal interface to Riverdi’s intelligent displays. In this way, the second display does nots need an external host controller and 2 independent displays can be controlled by one STM32
    • USB – can be configured to both Host and Device
    • Haptic feedback driver output – a DRV2605L haptic driver on the board (on I2C1) can be used to drive ERM and LRA haptic motors. Enhances feedback and conveys useful information to the users

    Riverdi STM32 Embedded Display unboxing

    Have a look what you will get when you will order a sample of STM32 Embedded Display:

    img3

    How to import this project to STM32CubeIDE:

    [1] Clone this respository (do not forget about –recursive flag!):

    git clone --recursive https://github.com/riverdi/riverdi-101-stm32h7-lvgl.git
    

    [2] Open STM32CubeIDE and import project:

    File => Open Projects from File System... => Directory => Select the "riverdi-101-stm32h7-lvgl/STM32CubeIde" folder => Finish
    

    [3] Build the project (for the best performance, please use Release configuration with -Ofast flag):

    Project => Build all
    

    [4] Upload the firmware to the Riverdi STM32 Embedded Display

    TODO

    • performance improvements,
    • enable direct mode with double buffering,
    Visit original content creator repository https://github.com/riverdi/riverdi-101-stm32h7-lvgl
  • mobile-app

    React Native Template for Taro

    requirement

    1. taro: @tarojs/cli@^3.5.0
    2. framework: ‘react’

    quick start

    install react native library

    install peerDependencies of @tarojs/taro-rn @tarojs/components-rn and @tarojs/router-rn, it will also run post-install. please modify and run upgradePeerdeps script when you change taro version.

    run this script after project inited.

    yarn upgradePeerdeps

    pod install

    run this script when you add new react native library or update react native library version.

    see pod-install for more infomation.

    yarn podInstall

    start ios app

    yarn ios

    start android app

    yarn android

    start bundler

    yarn start

    more infomations

    1. development process of taro react native
    2. github

    release

    build ios bundle

    yarn build:rn --platform ios

    build Android bundle

    yarn build:rn --platform android

    release ios APP

    see publishing-to-app-store for details.

    release android apk

    see signed-apk-android for details.

    github workflows

    use github actions to build your apps. this template include basic github action config.

    see .github/workflows for details.

    events

    we assemble debug and release product for both android and ios when you push or pull request on master branch by default. design your own workflows by modify .github/workflows files.

    see events-that-trigger-workflows

    ios

    configuration

    Modify the following configuration items for package and publish your app.

    .github/workflows/assemble_ios_debug.yml
    .github/workflows/assemble_ios_release.yml

    env:
      APP_ID: com.taro.demo # Application Product Bundle Identifier
      APP_NAME: Taro Demo # The Display Name of your app
      VERSION_NUMBER: 1.0.0 # Application version number
      BUILD_NUMBER: 1.0.0.0 # Application build number, used by release only.
      TEAM_ID: XXXXXXXXXX # Team ID, is used when upgrading project
      PROVISIONING_PROFILE_SPECIFIER: Product_profile # Provisioning profile name to use for code signing
      CODE_SIGN_IDENTITY: iPhone Distribution # Code signing identity type (iPhone Developer, iPhone Distribution)
      SIGNING_CERTIFICATE_P12_DATA: ${{secrets.RELEASE_SIGNING_CERTIFICATE_P12_DATA}}
      SIGNING_CERTIFICATE_PASSWORD: ${{secrets.RELEASE_SIGNING_CERTIFICATE_PASSWORD}}
      PROVISIONING_PROFILE_DATA: ${{secrets.RELEASE_PROVISIONING_PROFILE_DATA}}
      APP_STORE_CONNECT_USERNAME: ${{secrets.APP_STORE_CONNECT_USERNAME}} # This secret should be set to the Apple ID of your developer account, used by release only.
      APP_STORE_CONNECT_PASSWORD: ${{secrets.APP_STORE_CONNECT_PASSWORD}} # used by release only.

    values like ${{secrets.xxxxx}} are manually generated and store in your github encrypted secrets.

    SIGNING_CERTIFICATE_P12_DATA

    cat Certificates.p12 | base64 | pbcopy

    SIGNING_CERTIFICATE_PASSWORD

    encryption password of your Personal Information Exchange (.p12)

    PROVISIONING_PROFILE_DATA

    cat profile.mobileprovision | base64 | pbcopy

    APP_STORE_CONNECT_PASSWORD

    This secret should be set to an application-specific password for your Apple ID account. Follow these instructions to create an application-specific password.

    Read more

    1. deploy an ios app to testflight or the app store using github actions
    2. encrypted-secrets
    3. fastlane

    android

    configuration

    Modify the following configuration items for package and publish your app.

    .github/workflows/assemble_android_debug.yml
    .github/workflows/assemble_android_release.yml

    env:
      APP_ID: com.taro.demo  # Application Product Bundle Identifier
      APP_NAME: Taro Demo  # The Display Name of your app
      APP_ICON: ic_launcher  # The Application icon of your app
      APP_ROUND_ICON: ic_launcher_round  # The Application round icon of your app
      APP_ABI_FILTERS: armeabi-v7a, arm64-v8a # App abi filters
      VERSION_NAME: 1.0.0 # version name
      VERSION_CODE: 10 # version code
      KEYSTORE_FILE: debug.keystore # key store file
      KEYSTORE_PASSWORD: android # key store password
      KEYSTORE_KEY_ALIAS: androiddebugkey # key store key alias
      KEYSTORE_KEY_PASSWORD: android # key store key password

    For the security of your app, please regenerate the .keystore file and store the password in your github encrypted secrets.

    Read more

    1. app signing
    2. encrypted-secrets

    links

    1. template source code
    2. sample project

    Visit original content creator repository
    https://github.com/proclml/mobile-app