IT |
気になる、記になる… |
エム・エス・シー、ハイブリッドANC搭載イヤフォン「urbanista ATLANTA」を発売 |
https://taisy0.com/2023/01/24/167469.html
|
bluetooth |
2023-01-24 13:23:55 |
IT |
気になる、記になる… |
M2 Pro/M2 Maxチップ搭載「MacBook Pro 14/16インチ」のSSDは書き込み速度が速いのが特徴 |
https://taisy0.com/2023/01/24/167548.html
|
macbookpro |
2023-01-24 13:16:26 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
ハッシュの基礎 |
https://qiita.com/ta--i/items/08c1dee490f2110c066d
|
hashonetwothree |
2023-01-24 22:48:02 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
s3にアップロードしたファイルをaws cliを用いて更新する方法 |
https://qiita.com/shuhei_m/items/475fc86c3844fd15242f
|
awscli |
2023-01-24 22:27:32 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
だれでもわかるGitの使い方 |
https://qiita.com/akikaki_san/items/c3c35e10876dc81e6b50
|
感じ |
2023-01-24 22:33:15 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
.gitignoreの記載ファイルが反映されない |
https://qiita.com/gorillaprog0301/items/dc443a2a97f8e9ce475a
|
gitignore |
2023-01-24 22:19:14 |
js |
JSer.info |
2023-01-24のJS: Bun v0.5、Remix v1.11.0、メモリリークの調査 |
https://jser.info/2023/01/24/bun-v0.5-remix-v1.11.0/
|
FlatRoutes·Discussion·remixrunremixFixingaMemoryLeakinaProductionNodejsAppという記事と動画では、Nodejsのウェブアプリケーションで発生したメモリリークの原因を調査し、どのように修正していったかについて書かれています。 |
2023-01-24 22:23:07 |
技術ブログ |
Developers.IO |
CodeDeployでAutoScalingグループにデプロイする設定をCloudFormationで作成してみた |
https://dev.classmethod.jp/articles/deploy-to-autoscaling-group-in-codedeploy-with-cloudformation/
|
cloudforma |
2023-01-24 13:26:15 |
海外TECH |
MakeUseOf |
How to Check the Battery Health of Your MacBook |
https://www.makeuseof.com/how-to-check-macbook-battery-health/
|
health |
2023-01-24 13:30:16 |
海外TECH |
DEV Community |
refine vs RedwoodJS |
https://dev.to/refine/refine-vs-redwoodjs-37p9
|
refine vs RedwoodJSAuthor Madars BišsModern full stack applications are often based on data components like admin panels dashboards and internal tools It may take a lot of time and involve repetitive work to create them from scratch each time In this article we will compare two open source React frameworks that can be used to build CRUD applications refine and Redwood The first one is designed to accelerate the development of data rich apps and includes a wide library of hooks components and providers The other is a full fledged framework that is marketed as the best choice for startups We will review anything from the core features history installation build structure frontend database backend and deployment options for both Overview refinerefine is a React framework that aims to eliminate repetitive work and offers pre built solutions for routing authentication internationalization and many other features that you would frequently implement in full stack apps It is based on a headless architecture meaning users are not tied to any specific stack of technologies styling solutions and settings It allows you to focus on business logic and use the framework just to support you The project has experienced rapid growth since its release in On GitHub developers have made around contributions As of the start of the project has been already starred times RedwoodRedwood is a React framework designed to keep you moving fast as your app grows from side project to startup It it based on several core technologies GraphQL for making API calls Prisma as an ORM TypeScript for type safety optional Jest for testing Pino for logging and Storybook to assist with creating UI Since its release in the project has received over contributions on GitHub by developers As of the start of the project has already been starred more than times Installation refineThe recommended way to set up a new refine project is to use their built in CLI tool create refine app Run the command npm create refine app latest crud refine and it will take you through a terminal wizard You will be asked to pick your preferred router solution UI framework auth provider in approach and other settings For testing purposes choose the settings provided below Once the installation setup is completed change the working direction to the newly created project folder by running cd crud refine and start the development server via npm run dev It should automatically open up a new tab on your default browser with the application preview If it does not open http localhost manually You should be presented with the welcome screen of refine RedwoodIn order to set up a new Redwood app open the terminal and run the command yarn create redwood app crud redwood typescript If you prefer to set up the project on Vanilla JS remove typescript tag from the command Notice that Yarn package manager is the requirement to create a project During the terminal wizard you will be asked whether or not to initialize the git repository The rest of the wizard is fully automatic and should not take more than a couple of minutes to finish Next change your working directory to the newly created project folder via cd crud redwood and start the developer server by running yarn rw dev It should open a new tab on your default browser with the working project demo If it s not run http localhost to see the Redwood welcome page Internal build refineOut of the box refine file structure is as simple as it gets The user is provided with just the bare minimum to be able to work with a functional React app There is the App tsx file where the main logic of the app lives The core refine functionality is achieved via the Refine component which receives all of the application settings as props We can see all of the installed packages like Ant Design route provider and data provider already imported and passed successfully so we can use them in the refine app Here is what the App tsx file should look like import Refine from pankod refine core import notificationProvider Layout ReadyPage ErrorComponent from pankod refine antd import pankod refine antd dist reset css import dataProvider from pankod refine simple rest import routerProvider from pankod refine react router v function App return lt Refine dataProvider dataProvider notificationProvider notificationProvider Layout Layout ReadyPage ReadyPage catchAll lt ErrorComponent gt routerProvider routerProvider resources gt export default App Finally there is the index tsx file in the src root direction which renders the whole app to the screen The code structure should be similar to this import React from react import createRoot from react dom client import App from App const container document getElementById root as HTMLElement const root createRoot container root render lt React StrictMode gt lt App gt lt React StrictMode gt RedwoodRedwood framework gives you a much more complex file structure right out of the gate It is a full fledged framework that recommends how you should go with authentication database separate logic from layout and so on If we take a closer look at the internal build of a Redwood project we easily notice that the whole app is divided into two main blocks The first is the api directory which deals with the backend and databases and the second is the web directory which deals with the front end styling and routing ├ーapi│├ーdb││└ーschema prisma│├ーdist│├ーsrc││├ーdirectives│││├ーrequireAuth│││└ーskipAuth││├ーfunctions│││└ーgraphql js││├ーgraphql││├ーlib│││├ーauth js│││├ーdb js│││└ーlogger js││└ーservices│└ーtypes└ーweb ├ーpublic └ーsrc ├ーcomponents ├ーlayouts ├ーpages │├ーFatalErrorPage ││└ーFatalErrorPage tsx │└ーNotFoundPage │└ーNotFoundPage tsx ├ーApp tsx ├ーindex css ├ーindex html └ーRoutes tsxThe api folder is further divided into the db directory which holds the Prisma schema dist for compiled code and the src folder which holds the information about GraphQL schema lambda functions and additional information required to configure authentication and logging The web folder holds the main App jsx file for the app logic Routes tsx for routing configuration as well index css for styling There is also a dedicated folder for pages layouts and components to separate reusable code blocks Pages and routing refineIn order to create the first page run the following command in the terminal npm run refine create resource test actions list This will create a new folder pages and include new files list tsx and index ts and link everything to the Refine component Check your App tsx file and it should now look like this import Refine from pankod refine core import notificationProvider Layout ReadyPage ErrorComponent from pankod refine antd import pankod refine antd dist reset css import dataProvider from pankod refine simple rest import routerProvider from pankod refine react router v import TestList from pages tests function App return lt Refine dataProvider dataProvider notificationProvider notificationProvider Layout Layout ReadyPage ReadyPage catchAll lt ErrorComponent gt routerProvider routerProvider resources name test list TestList gt export default App Now let s create a page to display some sample data Open the newly created list tsx file in the pages folder and change the content to the following code export const TestList gt return lt gt lt h gt TestPage lt h gt lt p gt Find me in lt code gt src pages tests list tsx lt code gt lt p gt lt gt To test the route open your browser and navigate to http localhost test You should be presented with the following view RedwoodTo create your first page in the Redwood project run the command yarn rw generate page test It will create a new file TestPage tsx inside the pages directory with the following code in it import Link routes from redwoodjs router import MetaTags from redwoodjs web const TestPage gt return lt gt lt MetaTags title Test description Test page gt lt h gt TestPage lt h gt lt p gt Find me in lt code gt web src pages TestPage TestPage tsx lt code gt lt p gt lt p gt My default route is named lt code gt test lt code gt link to me with lt Link to routes test gt Test lt Link gt lt p gt lt gt export default TestPage To test it out run http localhost test in your browser and you should be presented with something like this Small dev teams love this React framework Meet the headless React based solution to build sleek CRUD applications refine expertly combines cutting edge technologies under a robust architecture so you don t have to spend time researching and evaluating solutions Try refine to rapidly build your next CRUD project whether it s an admin panel dashboard internal tool or storefront Data sources refineIn order to set up data for the application refine has a built in REST data provider that could simulate the use of the database We already imported it in the initialization phase while setting up the app All we have to do is to check App tsx and make sure it is passed in the Refine component as a dataProvider like so function App return lt Refine dataProvider dataProvider gt We can also check the data coming from the data provider Open your browser and navigate to You will be presented with all the available endpoints For this application we will use the posts route so click on it and you will see sample data that is provided to the user Make sure to install JSON formatter so the returned data is formatted and easy to read RedwoodRedwood does not come with the sample database so we will create an SQLite and populate it with some sample data Open the schema prisma file located in the api directory under the db folder and paste the following code datasource db provider sqlite url env DATABASE URL generator client provider prisma client js binaryTargets native model Post id Int id default autoincrement title String Migrate the new changes with the command yarn rw prisma migrate dev for the new schema to take effect Redwood also comes with Prisma studio so we get a graphical user interface GUI to work with database records To access it run yarn rw prisma studio It will open it up on http localhost Click on the Post model and add some records into the database so we have data to work with CRUD approach RefineIn order to implement the create read update and delete functionality run the following command in the terminal npm run refine create resource post This will create new files list tsx show tsx create tsx edit tsx and index ts in the pages directory and link everything to the Refine component Check your App tsx file and change it to the following import Refine from pankod refine core import notificationProvider Layout ReadyPage ErrorComponent from pankod refine antd import pankod refine antd dist reset css import dataProvider from pankod refine simple rest import routerProvider from pankod refine react router v import PostList PostCreate PostEdit PostShow from pages posts function App return lt Refine dataProvider dataProvider notificationProvider notificationProvider Layout Layout ReadyPage ReadyPage catchAll lt ErrorComponent gt routerProvider routerProvider resources name posts list PostList create PostCreate edit PostEdit show PostShow gt export default App Next open the list tsx file and replace the current content with the following code import List Table TextField useTable DateField Space EditButton DeleteButton ShowButton from pankod refine antd import IPost from interfaces export const PostList React FC gt const tableProps useTable lt IPost gt return lt List gt lt Table tableProps rowKey id gt lt Table Column dataIndex id key id title ID render value gt lt TextField value value gt gt lt Table Column dataIndex title key title title Title render value gt lt TextField value value gt gt lt Table Column dataIndex createdAt key createdAt title Created At render value gt lt DateField value value format LLL gt gt lt Table Column lt IPost gt title Actions dataIndex actions render record gt lt Space gt lt EditButton hideText size small recordItemId record id gt lt ShowButton hideText size small recordItemId record id gt lt DeleteButton hideText size small recordItemId record id gt lt Space gt gt lt Table gt lt List gt Notice we already imported an interface to work with TypeScript Create a new folder interfaces in the src root and include the index d ts file with the following code export interface IPost id number title string createdAt string Now test the posts route on http localhost posts This route will allow us to display all the data from the data provider and display the action buttons Let s also create a feature to create new records Open the create tsx file in the pages folder and paste the following code into the file import Create Form Input useForm from pankod refine antd import IPost from interfaces export const PostCreate React FC gt const formProps saveButtonProps useForm lt IPost gt return lt Create saveButtonProps saveButtonProps gt lt Form formProps layout vertical gt lt Form Item label Title name title rules required true gt lt Input gt lt Form Item gt lt Form gt lt Create gt Now every time we want to create a new record we have a dedicated route http localhost posts create for it Next we will want to update the records For that open the edit tsx file and change the content to the following code import Edit Form Input useForm from pankod refine antd import IPost from interfaces export const PostEdit React FC gt const formProps saveButtonProps useForm lt IPost gt return lt Edit saveButtonProps saveButtonProps gt lt Form formProps layout vertical gt lt Form Item label Title name title rules required true gt lt Input gt lt Form Item gt lt Form gt lt Edit gt Each time there is the need to update some record users will be presented with the current values that could be editable The posts can be edited via http localhost posts edit where the number behind the last forward slash is the ID of the post Finally users should be able to see individual posts by opening them separately For that open show tsx file and include the following code import useShow from pankod refine core import Show Typography from pankod refine antd import IPost from interfaces const Title Text Typography export const PostShow React FC gt const queryResult useShow lt IPost gt const data isLoading queryResult const record data data return lt Show isLoading isLoading gt lt Title level gt Title lt Title gt lt Text gt record title lt Text gt lt Show gt To read the data users will be able to click on individual records and they will be opened in the new route Each post will be accessible on the http localhost posts show where the number behind the last forward slash is the ID of the post Users are also able to delete any record from the app by clicking on the bin icon The UI is handled via a modal where they are first asked to confirm the decision RedwoodIn order to create the CRUD functionality in the Redwood app run the following command on the terminal yarn rw g scaffold post Redwood first created individual components to create read update and delete posts in the components folder Here is the example of PostCell tsx that uses GraphQL to fetch the data import type FindPostById from types graphql import type CellSuccessProps CellFailureProps from redwoodjs web import Post from src components Post Post export const QUERY gql query FindPostById id Int post post id id id title export const Loading gt lt div gt Loading lt div gt export const Empty gt lt div gt Post not found lt div gt export const Failure error CellFailureProps gt lt div className rw cell error gt error message lt div gt export const Success post CellSuccessProps lt FindPostById gt gt return lt Post post post gt After that Redwood created a separate page for each CRUD action in the pages folder and imported the component to keep the code organized and easier to manage Here is the example of PostPage tsx import PostCell from src components Post PostCell type PostPageProps id number const PostPage id PostPageProps gt return lt PostCell id id gt export default PostPage To see it working access the route on http localhost posts which would display all of the posts available in the database In order to create a new post navigate to http localhost posts new Now try to open any of the individual posts via http localhost posts where the number after the last slash in the URL is the ID of the particular post Similarly you can edit any of the posts in the database via http localhost posts edit And finally the user is also able to delete any of the posts Before the actual deletion the user is presented with the alert asking to confirm the decision Authentication RefineWe will use Auth provider to implement the authentication in our refine app First we must install the required Auth package via the commandnpm install auth auth react For authentication to work the whole app needs to be wrapped in the Auth provider The most appropriate place for that is the index tsx file in the src directory root Change it to the following import React from react import createRoot from react dom client import AuthProvider from auth auth react import App from App const container document getElementById root const root createRoot container root render lt React StrictMode gt lt AuthProvider domain process env REACT APP AUTH DOMAIN as string clientId process env REACT APP AUTH CLIENT ID as string redirectUri window location origin gt lt App gt lt AuthProvider gt lt React StrictMode gt Now create a new account on Auth Once logged in create a new application by selecting Single page web application After that navigate to the Settings panel and you will get the keys for domain client id and client secret Now scroll down the settings and configure the callback logout and web origins URLs like shown below Go back to the refine app create a file env in the app root and paste the following environment values Now restart the developer server for the changes to take effect Press Ctrl C on your keyboard to close the server and run npm run dev to start it again Then create a new file login tsx inside the src directory and include the following code import AntdLayout Button from pankod refine antd import useAuth from auth auth react export const Login React FC gt const loginWithRedirect useAuth return lt AntdLayout style backgroundSize cover gt lt div style height vh display flex gt lt div style maxWidth px margin auto gt lt Button type primary size large block onClick gt loginWithRedirect gt Sign in to refine app lt Button gt lt div gt lt div gt lt AntdLayout gt Finally open the Apx tsx file and paste the following code import Refine AuthProvider from pankod refine core import notificationProvider Layout ErrorComponent from pankod refine antd import dataProvider from pankod refine simple rest import routerProvider from pankod refine react router v import useAuth from auth auth react import axios from axios import pankod refine antd dist reset css import PostList PostCreate PostEdit PostShow from pages posts import Login from pages login const API URL const App React FC gt const isLoading user logout getIdTokenClaims useAuth if isLoading return lt span gt loading lt span gt const authProvider AuthProvider login gt return Promise resolve false logout gt logout returnTo window location origin return Promise resolve checkError gt Promise resolve checkAuth async gt try const token await getIdTokenClaims if token axios defaults headers common Authorization Bearer token raw return Promise resolve else return Promise reject catch error return Promise reject getPermissions gt Promise resolve getUserIdentity async gt if user return Promise resolve user avatar user picture return Promise reject return lt Refine LoginPage Login authProvider authProvider dataProvider dataProvider API URL axios routerProvider routerProvider notificationProvider notificationProvider Layout Layout catchAll lt ErrorComponent gt resources name posts list PostList create PostCreate edit PostEdit show PostShow gt export default App Now every time user wants to access the app he she will be asked to authenticate via the login screen And once the user is done there will be an option to log out RedwoodWe will use Auth to create an authentication example for our Redwood app Start by installing the required settings by running the following command in the terminal yarn rw setup auth auth That will create an auth wrapper around the application in the App tsx file which should now look like this import AuthProvider from redwoodjs auth import AuthClient from auth auth spa js import FatalErrorBoundary RedwoodProvider from redwoodjs web import RedwoodApolloProvider from redwoodjs web apollo import FatalErrorPage from src pages FatalErrorPage import Routes from src Routes import scaffold css import index css const auth new AuthClient domain process env AUTH DOMAIN client id process env AUTH CLIENT ID redirect uri process env AUTH REDIRECT URI cacheLocation localstorage audience process env AUTH AUDIENCE const App gt lt FatalErrorBoundary page FatalErrorPage gt lt RedwoodProvider titleTemplate PageTitle AppTitle gt lt AuthProvider client auth type auth gt lt RedwoodApolloProvider gt lt Routes gt lt RedwoodApolloProvider gt lt AuthProvider gt lt RedwoodProvider gt lt FatalErrorBoundary gt export default App Now navigate to the layouts folder find the file ScaffoldLayout tsx and replace the content with the following content import Link routes from redwoodjs router import Toaster from redwoodjs web toast import useAuth from redwoodjs auth type LayoutProps title string titleTo string buttonLabel string buttonTo string children React ReactNode const ScaffoldLayout title titleTo buttonLabel buttonTo children LayoutProps gt const logIn logOut isAuthenticated useAuth return isAuthenticated lt div style height vh display grid placeItems center gt lt button style padding px px backgroundColor D border none borderRadius px color white cursor pointer onClick logIn gt Sign In to Redwood app lt button gt lt div gt lt div className rw scaffold gt lt Toaster toastOptions className rw toast duration gt lt header className rw header gt lt h className rw heading rw heading primary gt lt Link to routes titleTo className rw link gt title lt Link gt lt h gt lt Link to routes buttonTo className rw button rw button green gt lt div className rw button icon gt lt div gt buttonLabel lt Link gt lt button className link button onClick logOut gt Log Out lt button gt lt header gt lt main className rw main gt children lt main gt lt div gt export default ScaffoldLayout Import the Layout for all the routes of the app Open the Routes tsx file and change its content to the following code import Set Router Route from redwoodjs router import ScaffoldLayout from src layouts ScaffoldLayout const Routes gt return lt Router gt lt Set wrap ScaffoldLayout title Posts titleTo posts buttonLabel New Post buttonTo newPost gt lt Route path posts new page PostNewPostPage name newPost gt lt Route path posts id Int edit page PostEditPostPage name editPost gt lt Route path posts id Int page PostPostPage name post gt lt Route path posts page PostPostsPage name posts gt lt Route path page PostPostsPage name posts gt lt Set gt lt Router gt export default Routes Next create a new Auth account if you already do not have one Once logged in create a new application by selecting Single page web application After that navigate to the Settings panel and you will get the keys for domain client iId and client secret Scroll down the Settings and set the callback logout and web origins URLs as shown below Go back to the refine app and paste those environmental variables into the env file in the project root as shown below Now restart the developer server for the changes to take effect Press Ctrl C on your keyboard to close the server and run yarn rw dev to start it again Now try to access the app via http localhost and you will be asked to log in to view the content After successful login you will be taken to the app allowing access to all the content There will also be an option to log out Deployment refineDeploying a refine app is as easy as it would be with any other React app First make sure to push your code to GitHub Create a new account if you do not have one already log in and create a new repository to host the code Switch back to the code editor and run the following commands on your terminal Make sure to replace the GitHub user name with your own in the first command git remote add origin git branch M maingit push u origin mainOnce the code is successfully pushed refresh your GitHub repository and you should see all of your project files Next create a Vercel account if you do not have one Select Import from Git which will let you set up the project from the GitHub that we just pushed The only thing required for you to do is to provide the environmental keys the same way you did in the local instance of the application Once that s done click on Deploy The deployment process is fully automatic and once everything is completed you will receive a live link to your deployed project Congratulations your site is now live the live link will be provided by Vercel Before clicking on the link make sure to visit Auth open the refine project navigate to the Settings panel and change the domain URL for a callback logout and web origins given by Vercel previously set to http localhost RedwoodSince we designed a separate database for our Redwood project we will first need to find an online provider that would support that A great solution for this is Railway which will allow us to spin up a free Postgres instance Create a new Railway account first if you do not have one already Then create a new project and pick a new Postgres instance Open the newly created Postgres instance and select the Connect tab Here you will access the database connection keys that we will need later Now switch back to your local Redwood project and change the database type in the schema prisma file to PostgreSQL It should now look like this datasource db provider postgresql url env DATABASE URL generator client provider prisma client js binaryTargets native model Post id Int id default autoincrement title String Now add the database connection string from Railway in the env file like this Next remove the migrations folder inside the api directory Restart the development server by pressing Ctrl C on your keyboard start it again by running the command yarn rw dev and run the database migration for the changes to take effect by the command yarn rw prisma migrate dev We will also need to add some configuration for the environmental values and the API path so the host can read them Create a new file redwood toml in the app root if you already do not have one and include the following code web title Redwood App port apiUrl api includeEnvironmentVariables AUTH DOMAIN AUTH CLIENT ID AUTH CLIENT SECRET AUTH AUDIENCE AUTH REDIRECT URI DATABASE URL api port browser open trueNow it is time to push the code to GitHub Create a new account if you do not have one already and create a new repository Run the following command on the terminal to push the code Make sure to replace the GitHub user name with your own in the first command git remote add origin git branch M maingit push u origin mainOnce successfully pushed you will have the project available on the repository We will use Vercel to deploy the front end Create a new account if you already do not have one Select Import from Git which will let you set up the project from the GitHub that we just pushed The only thing required for you to do is to provide the environmental keys the same way you did in the local instance of the application The deployment process is fully automatic and once everything is completed you will receive a live link to your deployed project Congratulations your site is now live Vercel will provide you with the live link for the project Before clicking on the link make sure to visit Auth open the refine project navigate to the Settings panel and change the domain URL for a callback logout and web origins given by Vercel previously set to http localhost ConclusionBoth frameworks can be efficiently used to create CRUD applications Choosing any of them and getting proficient with them will definitely speed up the development progress for full stack apps Both frameworks have terminal wizards to set them up both provide the scaffolding commands to set up the routes and resources for the app both support various styling solutions authentication alternatives and are easy to deploy The core differences are in the internal structure the level of abstraction each provides after the initialization of the project and the core tech stack each of them uses to achieve CRUD functionality I would recommend using refine for developers who are seeking full control and a higher level of customization refine allows users to fully focus on business logic and the provided framework project structure is minimal refine also has a data API that could be used to create a full stack app example without relying on a database With Redwood you are expected to use Prisma and create a database schema to handle the CRUD operations on data Redwood provides a more complex framework structure and the user has less control over the file tree Users are requested to work with GraphQL and the installation wizard sets support for tools like StoryBlock Jest and Pino |
2023-01-24 13:52:44 |
海外TECH |
DEV Community |
Turn CV to structured data with GPT-3 and Node.js |
https://dev.to/superface/turn-cv-to-structured-data-with-gpt-3-and-nodejs-398d
|
Turn CV to structured data with GPT and Node jsLarge language models like GPT are useful to simplify routine tasks For example we can take unstructured data like a job applicant s resume in PDF and turn them into structured data and fill them into our Applicant Tracking System ATS like Greenhouse or Workable In this article I will show you a Node js application which does that But while GPT simplifies routine data entry jobs as developers we still need to connect all the respective APIs to download the applicant s CV get text from the PDF and put data to the ATS Luckily Superface gets us rid of this routine API wiring We provide a unified interface across many API providers Switching from for example Workable to Breezy HR is a one line change Let s check what steps this application does Loads a CV of a candidate who applied for a given job from an Applicant Tracking System ATS like Workable or Greenhouse Converts the CV to text and parses the text into machine readable data Updates the candidate in the ATS with the data obtained from the CV You can find the complete application in the CV Analyzer repository It uses the following packages superfaceai one sdk Superface OneSDK is used to integrate with ATS OpenAI and Cloudmersive SaaS providers node fetch NodeFetch is used to fetch the CV document dotenv dotenv is used to load environment variables inquirer Inquirer js is used to build interactive user interface We also rely on these use cases from Superface Catalog List JobsList CandidatesGet CVConvert Document to TextText completionUpdate CandidateIn this demo we use Workable as ATS Cloudmersive to convert a candidate s CV to plain text and OpenAI provider for conversion of CV to structured data But you are not limited to just this three providers For ATS use cases you can use also Breezy HR Greenhouse and many others Setting up the applicationClone the app repository and enter its directory git clone git github com superfaceai cv analyzer git cd cv analyzerInstall dependencies npm installCreate accounts if you do not have them already for the providers Workable offers days free trial A work e mail address is required to create the account Cloudmersive has a free tier limited to requests per month OpenAI offers a free trial with in free credit usable during the first months Copy the example env file cp env example envSet credentials and integration parameters for the providers in the env file Get Workable Access Token and Subdomain Create Cloudmersive Free Tier Key Create OpenAI Secret API Key Create a job position and add new candidate in Workable ATS Start the app npm startOnce the application starts it will show you a list of candidates When you pick one it will update candidate s entry with data parsed from their CV How the application worksThe main flow of the application is in the src index js file which calls use cases defined in src use cases js file Selecting the candidate and getting its CVFirst we list open job positions and candidates for the selected position This is handled with the List Jobs use case once the user picks a job position we use List Candidates use case with the respective ID of the job position exports listCandidates async sdk providerOptions jobId gt const listCandidatesProfile await sdk getProfile recruitment list candidates const listCandidatesResult await listCandidatesProfile getUseCase ListCandidates perform jobId providerOptions return listCandidatesResult unwrap candidates We take the ID of the selected candidate and use the Get CV use case to obtain the URL of a document with the candidate s resume typically that s a PDF but the ATS may accept other formats as well exports getCVUrl async sdk providerOptions candidateId gt const getCVProfile await sdk getProfile recruitment get cv const getCVResult await getCVProfile getUseCase GetCV perform candidateId providerOptions return getCVResult unwrap cv documentUrl Converting CV to textNow we know where the candidate s CV can be downloaded but we need to extract the text from it somehow We use Convert Document to Text use case for that we fetch the document and upload it to the conversion provider Cloudmersive in this example and get a plain text in return exports convertCVToText async sdk providerOptions cvDocumentUrl gt const docToTextProfile await sdk getProfile file conversion doc to text const fetchDocumentResponse await fetch cvDocumentUrl if fetchDocumentResponse body console error Failed to fetch CV document return const result await docToTextProfile getUseCase ConvertDocumentToText perform fileName cv pdf content BinaryData fromStream fetchDocumentResponse body providerOptions return result unwrap text Extracting structured dataNow it s time for some AI magic We use OpenAI s GPT model through the Text Completion use case We provide the model with a prompt explaining we need particular data returned as JSON exports analyzeCV async sdk providerOptions cvText gt try const generateTextProfile await sdk getProfile ai generate text const promptCommand Parse following job applicant resume and return json object with properties firstName lastName address phone education school fieldOfStudy studiedFrom ISO YYYY MM DD studiedTill ISO YYYY MM DD workHistory company position summary workedFrom ISO YYYY MM DD workedTill ISO YYYY MM DD const result await generateTextProfile getUseCase CompleteText perform prompt promptCommand cvText creativity approxMaxWords model large providerOptions analyzeCVOutcome result unwrap catch error console error Failed to analyze CV error If the analysis goes well and the model “completes our prompt we turn the returned completion to JSON const parsedCV JSON parse analyzeCVOutcome completions const mappedCV parsedCV education parsedCV education map school gt return school school school degree school degree fieldOfStudy school fieldOfStudy startedAt school studiedFrom ISO endedAt school studiedTill ISO workHistory parsedCV workHistory map work gt return mappedCV Update the candidate dataNow that we have a JSON with structured data extracted from the CV we can send the data back to the ATS to update the candidate s data using the Update Candidate use case exports updateCandidate async sdk providerOptions candidate gt const profile await sdk getProfile recruitment update candidate const result await profile getUseCase UpdateCandidate perform candidate providerOptions result unwrap return true Using another ATS If you take a look at the code there aren t any mentions of Workable Cloudmersive or OpenAI That s because the use cases are designed in provider neutral way In case of ATS we use a unified terminology so if you need to use another ATS you don t need to rewrite the whole application Instead you can change atsProviderOptions in src index js file Options for Workableconst atsProviderOptions provider workable parameters SUBDOMAIN process env WORKABLE SUBDOMAIN security bearer token token process env WORKABLE TOKEN And if you d like to use for example Breezy HR set atsProviderOptions like this Options for Breezy HRconst atsProviderOptions provider breezy hr parameters COMPANY ID process env BREEZY HR COMPANY ID ACCESS TOKEN process env BREEZY HR ACCESS TOKEN Next stepsIn this demo application we ve used different API use cases from different API providers without ever looking at the API docs That s the advantage of Superface Do you need to integrate Applicant Tracking Systems like Workable Lever or SAP SuccessFactors Check out our Applicant Tracking Systems integrations And don t miss other integrations in the Superface catalog |
2023-01-24 13:49:50 |
海外TECH |
DEV Community |
Smooth Scrolling with JS |
https://dev.to/shubhamtiwari909/smooth-scrolling-with-js-n56
|
Smooth Scrolling with JSHello Everyone today I will show how you can create smooth scrolling with Javascript as well as with CSS Let s get started What we are going to create With CSS only HTML lt header gt lt ul class nav gt lt li gt lt a class nav link href section gt Section lt a gt lt li gt lt li gt lt a class nav link href section gt Section lt a gt lt li gt lt li gt lt a class nav link href section gt Section lt a gt lt li gt lt li gt lt a class nav link href section gt Section lt a gt lt li gt lt li gt lt a class nav link href section gt Section lt a gt lt li gt lt ul gt lt header gt lt main gt lt section id section gt This is Section lt section gt lt section id section gt This is Section lt section gt lt section id section gt This is Section lt section gt lt section id section gt This is Section lt section gt lt section id section gt This is Section lt section gt lt main gt I have created a simple Header with Navbar and main with section The href attribute of the anchor tag and id attribute of section tag are same it means when we click on any anchor tag it will directly jump to the section it is connected with But it will jump to that section immediately like it just teleported there margin paddin box sizing border box scroll behavior smooth ul list style none a text decoration none nav position fixed top min width padding px display flex justify content center gap rem flex wrap wrap background color rebeccapurple nav link color white section height vh display grid place items center font size rem section background crimson color white section background violet section background lime section background cyan section background rgb color white I just styled the navbar and sections with some CSSAt the top I have used scroll behavior smooth this will make that auto scrolling to a particular section smooth when we click on any link that scrolls the view to that section Browser Support With JavascriptHTML and CSS part will be the same as above Just remove that scroll behavior smooth property from CSS code JavaScriptOlder Wayconst navbar document querySelector nav navbar addEventListener click e gt e preventDefault const target e target if target classList contains nav link const id e target getAttribute href Older browser Support const section document querySelector id getBoundingClientRect window scrollTo left section left window pageXOffset top section top window pageYOffset behavior smooth Using event target checking if the link which is clicked has a class name nav link if it does then get the href attribute value of that link By passing this href attribute value as id in the querySelector we will get the section which is connected to this link Example href section in anchor tag and id section in section tag querySelector will recieve the id directly like querySelector section What it is doing is just calculating the top and left value of the section using getBoundingClientRect method and bahavior smooth will make the scrolling smooth There is better method of doing this so you can just not go in depth for this one Modern Wayconst navbar document querySelector nav navbar addEventListener click e gt e preventDefault const target e target if target classList contains nav link const id e target getAttribute href document querySelector id scrollIntoView behavior smooth We have another method called scrollIntoView we just need to apply this method to the section container with bahavior smooth parameter and it will make the scrolling smooth Browser support for thisTHANK YOU FOR CHECKING THIS POSTYou can contact me on Instagram LinkedIn Email shubhmtiwri gmail com You can help me with some donation at the link below Thank you gt lt Also check these posts as well |
2023-01-24 13:49:08 |
海外TECH |
DEV Community |
Career Question: To Specialize or Not To Specialize? |
https://dev.to/codewithvoid/career-question-to-specialize-or-not-to-specialize-dfd
|
Career Question To Specialize or Not To Specialize I dared initiating the age old debate on twitter ーto specialize or generalize replies later I think I have a better understanding of the best course of action for me My goal with this article is to summarize the discussion and present arguments people have for their choice Hope this will help you in making an informed decision that is ideal for your career stage Let s dive in TL DRPoll ResultsRationale For SpecializationRationale For GeneralizationConclusion Poll ResultsHere s a quick summary of the responses Looking at the results of developers believe that specialization is the way to go while are inclined towards generalization While we have a clear winner it s important to examine the reasoning and motivations behind these responses Rationale For SpecializationMore job opportunities Specializing can lead to more opportunities and success as a freelancer or contractor It s also clear to your employer what value you bring to the table Building credibility With specialization you build credibility by developing a deep understanding of the subject matter It gives you the ability to solve complex problems and create innovative solutions To show expertise If you are working on a specific area or technology for years you naturally build a reputation as an expert Rationale For GeneralizationMore flexibility With your ability to quickly understand and work with multiple technologies as a generalist you can move into different roles and industries Better adaptability You will easily adapt to new situations or technologies that you will encounter in your work To find passion Generalizing at first can help in finding what you love Something that you can focus on for a long period of time and make it your speciality ConclusionMajor takeaway for me from the discussion is there is no RIGHT answer to this question Also your choice can change as you will progress in career Having said that share in comments what do you think ーshould developers specialize or generalize If you liked this discussion follow me for more of these |
2023-01-24 13:18:14 |
海外TECH |
DEV Community |
Discovering open source repos with Quine |
https://dev.to/quine/browsing-open-source-repos-with-quine-3lhp
|
Discovering open source repos with QuineHello DevTo community This is Rodrigo from Quine a new platform that helps you find good first issues on GitHub based on your language and topic preferences Contributing to open source is difficult so we set ourselves to split up the contributor journey into small pieces and simplify each piece individually Probably one of the lengthiest and chaotic segments of the contributor journey is the discovery phase Opportunities to contribute to open source don t usually land on our hands In fact most contributors identify opportunities by solving bugs or adding features to the tools they use on a regular basis This is the most natural and organic way to add our grain of sand to a codebase but also a journey that we don t have much control over We think that discovering new repos on GitHub should be as easy as discovering new content on Reels or TikTok At Quine we re working very hard to make the process of picking a repo easy and fun All you have to do is choose your language and topic preferences and we ll point you in the right direction It is that easy So start browsing open source now by logging in to Quine and letting us know which topics and languages you re interested in Quine will automatically use this information to set your default search parameters Quine s tools for repo discovery don t end there Have you tried our feature for finding new tools and finding alternative repos If you have let us know what you think in the comments If not stay tuned we ll give them a proper introduction in our next post |
2023-01-24 13:01:32 |
Apple |
AppleInsider - Frontpage News |
Future HomePod could detect dancing & change the music automatically |
https://appleinsider.com/articles/23/01/24/future-homepod-could-detect-dancing-change-the-music-automatically?utm_medium=rss
|
Future HomePod could detect dancing amp change the music automaticallyAccording to a new patent Apple wants us to be able to dance wave gesture or just enter and leave rooms to have our smart devices like the HomePod do what we want I m sorry Dave I m afraid I can t do that Apple s HomePod already adjusts itself on setup to suit the acoustics of the room it s in But now Apple seems to want that scanning and room awareness to be much more precise ーand always on Read more |
2023-01-24 13:22:06 |
海外TECH |
Engadget |
LG's latest CineBeam ultra short-throw projector is a dream — if you can afford it |
https://www.engadget.com/lg-cinebeam-hu915qe-review-ust-projector-130042561.html?src=rss
|
LG x s latest CineBeam ultra short throw projector is a dream ーif you can afford itWho wouldn t want a small box that can spit a inch image onto your wall That s the basic pitch behind K ultra short throw UST projectors which are sometimes called Laser TVs They re technically easier to set up than traditional projectors and unlike large TVs they don t require a huge footprint Once you ve placed it in front of a screen or treated wall you can summon an enormous cinematic image in an instant We ve reviewed a few UST projectors over the years most recently Formovie s excellent model Personally I ve been in love with LG s Cinebeam HUL since we first saw it in action in Sure it was expensive at over but that was far less than the earlier models cost and certainly better than Sony s early eye watering to UST projectors Much like LG s first OLED TVs the CineBeam represented everything I wanted from the future of home cinema Now after spending a few months with the company s latest UST the CineBeam HUQE I m even more enamored It s brighter than its predecessor reaching up to lumens with a contrast ratio which makes it ideal for daytime viewing and HDR content Unfortunately it doesn t support Dolby Vision a rare feature we were surprised to see on the Formovie UST The new CineBeam can also be pushed even closer to your wall with the ability to spit out a inch K image from inches away or a inch image from inches I just wish it was cheaper than ーwith the Formovie unit coming in at thousands less it s hard to justify LG s premium The HUQE looks similar to most other UST projectors ーit s just a large rectangular box ーand its design is practically the same as the previous CineBeam Still LG gave it enough flair to make it look at home in a classy living room Its front speaker is covered in cloth and the entire unit is encased in a solid light gray plastic There s also a black model for better nighttime viewing though that one inexplicably spits out a darker image Around back there are three HDMI ports USB connections an optical audio port and Ethernet It s not exactly heavy at pounds but you definitely need a wide table or credenza to align it with your screen Devindra Hardawar EngadgetThat setup process by the way is more annoying than you d think Configuring any projector is a pain as you ll need to place it in just the right spot to fill your screen With a traditional long or short throw projector you re often able to shift the lens around manually But configuring a UST like the CineBeam involves finding the exact height and distance from the screen to make everything look perfect If it gets nudged by even a millimeter the image will simply look wrong That makes USTs less than ideal for homes with small children or overzealous pets Also you don t want kids peeking into the projector lens as it s bright enough to cause serious eye damage That s hard to do with a traditional projector but far too easy when it s just sitting on the floor When I tested the previous CineBeam HUL it took me a few hours to find the proper position to work alongside my dropdown projector screen That involved buying a small table and stacking a few wide boxes to get everything aligned Even then I couldn t quite get the image to fill every corner of my screen properly That s when I learned that dropdown screens aren t ideal for UST projectors Engadget s Steve Dent also found that small creases in dropdown screens could lead to rippled images Ultimately I was able to get the older CineBeam to fill around percent of my inch screen but I gave up on the dream of having the whole thing covered Thankfully I was able to drop the HUQE into the exact same spot as the earlier CineBeam After tweaking the manual focus wheel a bit it ended up covering the same area of my screen If you re building your home theater or living room around a UST projector you ll ideally want to use a tensioned ALR ambient light rejection screen Those are built to block light from everywhere but your projector which means they ll deliver even better brightness and contrast If you want to use a UST during the day like a TV you ll definitely want to push away as much ambient light as possible While my setup wasn t ideal the CineBeam HUQE still delivered most of what I wanted A large and luscious dose of cinema in my basement screening room Almost immediately I noticed that it produced richer and more vibrant colors than the CineBeam HUL Colorful films like Thor Ragnarok looked just fine on the previous projector but the new model delivered a far bolder dose of cosmic psychedelia The improved contrast also made the HUQE better suited for dark scenes like the spooky nighttime sequences in Nope where you re trying to make out something floating through the clouds The HUQE is a triple laser projector relying on red and blue lasers for their respective primary colors as well as another blue laser shining through a phosphor to create green That setup works well but it can only reach percent of the DCI P color gamut Newer UST projectors with three distinct RGB lasers like the HiSense PX Pro can reach a wider percent of the BT gamut Like many other UST units the HUQE relies on pixel shifting to achieve a visible K resolution It has a native resolution of x which is shifted twice to hit K The result is an image that s sharper than cheaper projectors which typically have p native resolutions with four phase shifting After spending a few hundred hours watching everything from streaming shows like Midnight Mass to blockbuster action films like Top Gun Maverick I found myself preferring the experience of using the HUQE compared to trekking out to the theater for many films And to be clear that s a pretty big deal for a movie lover like me Even with the COVID pandemic threatening the viability of theaters I ve held out hope for a comeback The strong box office performance of the Top Gun sequel and Avatar The Way of Water makes me think that there s still room for the true cinematic experience though as I write this Regal is shuttering more locations in the US after its parent company Cineworld declared bankruptcy last September Those films as well as the recent Dune adaptation are so large and bombastic that even a inch home projector can t fully capture their grandeur But the HUQE sure comes close Devindra Hardawar EngadgetLike most projectors the CineBeam HUQE isn t ideal for gaming thanks to its noticeable input lag Still I had a great time playing PS titles like God of War Ragnarok Ratchet and Clank Rift Apart and even the fast paced Returnal on my giant screen LG hasn t issued any latency figures but some reviews peg the projector s input lag between ms and ms There s an auto low latency mode that cuts off extra processing to speed things up but you obviously won t be using this thing for lightning fast competitive gaming Based on my experience with the inch Samsung Odyssey Ark though that s not something you d want to do on a gigantic display anyway Twitch gaming requires smaller screens so you can actually focus on all of the super fast action When it comes to sound I can t imagine that anyone buying a projector would be relying on built in speakers but it may make sense if you just want to avoid extra clutter in your living room The CineBeam s watt speaker setup sounds good enough for casual viewing it s certainly far better than what you d get on modern TVs It s basically a fairly simple soundbar sitting below the projector but it delivers clear dialogue and some surprisingly boomy bass Seriously though look into surround sound systems if you re actually buying this thing You deserve it Devindra Hardawar EngadgetWhile I spent most of my time using an Apple TV K the HUQE is also powered by LG s WebOS platform which offers all of the smart TV apps you d expect That s nice to have especially if you don t want to juggle multiple remotes but I d wager most home theater fans will stick with their set top box platform of choice If you re used to WebOS from LG s OLED TVs you ll feel right at home with this projector It even uses the same Magic Remote found on LG s TVs which has voice controls and so so motion controls As much as I loved the CineBeam HUQE it s not exactly priced competitively against newer entries like the Formovie Theater Sure that s not as bright but at half the price of the CineBeam that projector delivers Dolby Vision great sound and excellent image quality thanks to a modern triple laser setup You can easily add in an excellent surround sound system to match the CineBeam s price As for other high end competitors the HUQE competes directly with Hisense s much lauded LG which currently sells for to depending on the screen you get Samsung s Premiere LSPT triple laser UST also retailed for when it debuted though it can now be found for around at online sellers If you re an LG loyalist the CineBeam HUQE is still a very compelling UST projector It offers enough brightness to use during the day and it s vibrant enough in darker rooms to deliver a truly cinematic experience But it ll be an even better buy once it comes down in price |
2023-01-24 13:00:42 |
Cisco |
Cisco Blog |
Finding Purpose Through My Cisco Journey |
https://blogs.cisco.com/wearecisco/finding-purpose-through-my-cisco-journey
|
badge |
2023-01-24 13:00:45 |
海外TECH |
CodeProject Latest Articles |
A Custom Numeric UpDown Control |
https://www.codeproject.com/Tips/5352893/A-Custom-Numeric-UpDown-Control
|
application |
2023-01-24 13:36:00 |
ニュース |
BBC News - Home |
Richard Sharp: BBC chairman says he will not quit over Boris Johnson loan row |
https://www.bbc.co.uk/news/uk-64383742?at_medium=RSS&at_campaign=KARANGA
|
sharp |
2023-01-24 13:22:16 |
ニュース |
BBC News - Home |
Princess Eugenie pregnant with second child |
https://www.bbc.co.uk/news/uk-64388833?at_medium=RSS&at_campaign=KARANGA
|
british |
2023-01-24 13:29:14 |
ニュース |
BBC News - Home |
Police fears rise for baby missing in icy temperatures |
https://www.bbc.co.uk/news/uk-england-london-64388545?at_medium=RSS&at_campaign=KARANGA
|
january |
2023-01-24 13:36:42 |
ニュース |
BBC News - Home |
FIA suppressing drivers' freedom of speech - human rights group |
https://www.bbc.co.uk/sport/formula1/64387021?at_medium=RSS&at_campaign=KARANGA
|
FIA suppressing drivers x freedom of speech human rights groupA human rights group says Formula s governing body the FIA is suppressing drivers freedom of speech with a rule it has introduced this year |
2023-01-24 13:07:17 |
ニュース |
BBC News - Home |
Rufus McLean: Glasgow Warriors sack Scotland full-back after domestic abuse guilty plea |
https://www.bbc.co.uk/sport/rugby-union/64386319?at_medium=RSS&at_campaign=KARANGA
|
abuse |
2023-01-24 13:41:44 |
コメント
コメントを投稿