commit 74ae93a96ebd1188b51dafcb25607850d2efc491 Author: nm1 Date: Wed Nov 4 00:33:23 2026 +0530 initial diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Basics 3c39793aa5424ea9a779c784f89998a7.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Basics 3c39793aa5424ea9a779c784f89998a7.md new file mode 100644 index 0000000..ff42661 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Basics 3c39793aa5424ea9a779c784f89998a7.md @@ -0,0 +1,97 @@ +# Basics + +- URL + + + Source: [https://www.youtube.com/watch?v=AlkDbnbv7dk](https://www.youtube.com/watch?v=AlkDbnbv7dk) + + ![Untitled](../../_resources/Untitled-6.png) + + Path is like folder and resource is like a file + + IP address: **IP addresses enable websites, servers, and devices** +  to send and receive data from one another + + - IP and mac + + [https://superuser.com/questions/802421/can-a-website-see-know-my-mac-address-even-if-i-use-a-vpn](https://superuser.com/questions/802421/can-a-website-see-know-my-mac-address-even-if-i-use-a-vpn) + +- OSI + + + [https://www.youtube.com/watch?v=LANW3m7UgWs](https://www.youtube.com/watch?v=LANW3m7UgWs) + + ![Untitled](../../_resources/Untitled%201-3.png) + + # **The OSI model explained in simple terms** + + ![https://miro.medium.com/v2/resize:fill:88:88/1*5LGKFrOBrluX5roNbtvJiA.jpeg](https://miro.medium.com/v2/resize:fill:88:88/1*5LGKFrOBrluX5roNbtvJiA.jpeg) + + [Tom Nagle](https://tomanagle.medium.com/?source=post_page-----2abc3c7adadc--------------------------------) + + · + + Follow + + 4 min read + + · + + Jan 19, 2014 + + 213 + + 2 + + The Open System Interconnection model (OSI) is a seven layer model used to visualize computer networks. The OSI model is often viewed as complicated and many fear having to learn the model. However, the OSI model is an extremely useful tool for development and problem solving. Each of the seven layers goes up in increments of one as it gets closer to the human user. Layer one — the application layer, is closest to the person while layer seven — the physical layer is where the network receives and transmits raw data. The OSI model belongs to the International Organization for Standards (ISO) and is maintained by the identification ISO/IEC 7498–1. In this post, each of the seven layers of the OSI model will be explained in simple terms. The layers will be explained from layer seven to layer one, as this is where the data flow starts. + + ![https://miro.medium.com/v2/resize:fit:900/1*qiTX6rFTGN3UicsPapzY7g.jpeg](https://miro.medium.com/v2/resize:fit:900/1*qiTX6rFTGN3UicsPapzY7g.jpeg) + + # **The seven layers of the OSI model** + + # **Layer 7 — Application** + + The application layer is where the user inputs data and data is output to the user. The application layer is usually software that is run off the local machine, however this depends on the network architecture. The software could be cloud based, meaning it runs off a server in a remote location and data is transferred over the internet, or the software could be run on a local server. The application layer provides services for email, Telnet and file Transfer for example. An example of the application layer is an internet browser, an FTP client or even Microsoft Word. + + # **Layer 6 — Presentation** + + The presentation layer is where the operating system lies. This operating system could be Windows, OS X, a Unix based operating system or one of the many others available. Where the human user interacts with the application layer described above, the application layer interacts with the presentation layer. This may be done directly, or through a runtime environment such as the Java Runtime Environment (JRE). + + # **Layer 5 — Session** + + The session layer is responsible for creating and maintaining sessions between the operating system on the presentation layer and other, third party machines. For example, when a user is browsing the internet, they are interacting with the application layer, the application layer is interacting with the presentation layer and the session layer allows the operating system to interact with the web server. + + # **Layer 4 — Transport** + + The transport layer is responsible for the logistics of the session. In the example used above, the transport layer would be responsible for determining what and how much information is transferred between the operating system and the web server. + + # **Layer 3 — Network** + + The network layer is where routers operate. A router is a hardware device that forwards packets of information between computers on a network. This is where your IP address comes from and in the example used above, the router is responsible for sending packets of information out into the internet and receiving them. These packets origin and destination is determined by the IP address of your router. + + # **Layer 2 — Data link** + + The data link layer is where switches operate and provides a reliable link between two directly connected nodes. The data link layer is also responsible for detecting and possibly fixing any packet errors that may form on the physical layer. The data link layer is divided into two separate layers, the Media Access Control (MAC) and Logical Link Control (LLC) layers. The MAC layer is responsible for controlling how devices connected to the network gain access. The LLC layer controls error checking, possible fixes and packet synchronization. + + # **Layer 1 — Physical** + + The physical layer is literally the physical hardware that makes up the network. This layer has several major functions: + + - Defining physical specifications + - Defining protocols + - Defining transmission mode (half duplex & full duplex) + - Defining the network’s topology + + Hardware such as the physical components of Ethernet cables and Bluetooth are just some examples of the physical layer. + + # **Purpose of the OSI Model** + + Even after reading a description of each of the seven layers, you may still be confused as to how the OSI model applies to real life networking. It’s commonly misunderstood how a model can be used to solve real-life problems and in some cases, a model may not be the best approach. However, in many aspects of Information & Communications Technology(ICT), a model can be extremely useful and that is the case for the OSI model. + + When first discovering a networking problem, it can be confusing as to where you should start. The OSI model helps you to start figuring out where the problem may reside and therefore, help you to solve the problem. For example, a client’s computer is not able to reach a website. The problem is isolated to one device on the network, so it can be assumed that the problem is likely to be on the application layer. However, after testing you find that the problem still exists when you try a different web browser and so the application layer is ruled out. You then assume that the problem resides on the presentation layer and start looking for faulty settings. After some digging around you find that your client has entered some DNS settings incorrectly and so you then conclude the problem is on the presentation layer. + + You may already be using the OSI model for simple problem solving such as the example above without even realizing it. However, when dealing with large, corporate scale networking a purposeful use of the OSI model can make your job much easier and more enjoyable. + +- socket + + ![socket def.jpeg](../../_resources/socket_def.jpeg) \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/CSS cf8824c7de95492bab938154abcc0bfc.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/CSS cf8824c7de95492bab938154abcc0bfc.md new file mode 100644 index 0000000..05d46f3 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/CSS cf8824c7de95492bab938154abcc0bfc.md @@ -0,0 +1,456 @@ +# CSS + +- Sass handwritten + + [sass.pdf](../../_resources/sass.pdf) + + [sass.pdf](../../_resources/sass%201.pdf) + +- nth-child pseudoclass + + To select the list for specific number. + For eg: + + ```html + + ``` + + ```css + ul li:nth-child(2){ + color: red; + } + ``` + + instead of 2, odd or even can be used too. + + Output: + + ![Untitled](../../_resources/Untitled-5.png) + + also formula can be used like + + ```css + ul li:nth-child(4n+0){ + color: red; + } + ``` + + all multiples of 4 is selected + +- Caution while using flex + + When using flex layout, for eg to adjust div at center both horizontally and vertically. When we decrease height then upper portion gets out of screen too. To avoid this: set margin as auto for that div. + + ```css + html, + body, + #root, + .App { + height: 100%; + width: 100%; + } + + .App { + font-family: "Poppins", sans-serif; + + display: flex; + align-items: center; + justify-content: center; + } + + .calcBox { + margin: auto; + display: grid; + grid-template-columns: repeat(3, 1fr); + width: 350px; + grid-gap: 1rem; + padding: 1rem; + background-color: #696969; + border: 2px solid black; + border-radius: 2px; + + + } + ``` + + ```html +
+
+
+
+ ``` + +- Some important snippets + + minmax application: + + ```scss + /* Use of minmax */ + .List { + display: grid; + grid-template-columns: minmax(100px, 1fr) minmax(200px, 3fr) minmax( + 150px, + 2fr + ) minmax(100px, 1fr) minmax(100px, 1fr) minmax(200px, 3fr); + } + ``` + + - For inputButton properly implemented: + + ```html +
+
+ + +
+
+ ``` + + ```css + :root { + --deeppink: rgb(255, 0, 104); + --deeppinkDark: rgb(230, 0, 94); + } + + .Playlist { + margin-top: 5rem; + + display: flex; + justify-content: center; + width: 100%; + } + + .Playlist .playlistInput { + width: 50%; + min-width: 300px; + border: 4px solid var(--deeppink); + border-radius: 3px; + overflow-y: hidden; + /* padding: 0.5rem; */ + } + + .playlistInput input { + width: 80%; + /* height: 100%; */ + height: 2rem; + border: none; + outline: none; + padding: 0; + } + + .playlistInput button { + width: 20%; + height: 3rem; + background-color: var(--deeppink); + color: white; + border: none; + /* box-sizing: border-box; */ + cursor: pointer; + transition: all 0.1s ease-in-out; + } + + .playlistInput button:hover { + background-color: var(--deeppinkDark); + } + ``` + + + - Spinner + + ```jsx + import "./Spinner.css"; + + // use 'npm i react-loader-spinner@4.0.0 + import Loader from "react-loader-spinner"; + + // expected props: + // visible: boolean , + // classes: string, + // color: string, + // text: string + // https://mhnpd.github.io/react-loader-spinner/docs/category/components/ + /* text : Radio,Audio,Ball Triangle,Bars,Blocks,Circles With Bar,Circles,Color Ring,Comment,Discuss, + DNA,Falling Lines,Fidget Spinner,Grid,Hearts,Hourglass, + Infinity Spin,LineWave,MagnifyingGlass,Mutating Dots,Oval,Progress Bar,Puff, + RevolvingDot,Rings,Rotating Lines,Rotating Square, + Rotating Triangles,Tail Spin,Three Circles,Three Dots,Triangle, Vortex + , Watch*/ + function Spinner(props) { + const { visible, text, type } = props; + let classes = props.classes || ""; + const color = props.color || "#fff"; + let color1 = props.color; + // console.log("is spinner visible: ", visible); + return ( +
+ + + {text} + +
+ ); + } + + export default Spinner; + ``` + + ```css + .none { + display: none; + } + + .Spinner .Loading_Text { + font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + } + ``` + + other way +```js +import "./Spinner.scss"; + +function Spinner(props) { + const { visible, text, type } = props; + let classes = props.classes || ""; + const color = props.color || "#fff"; + let color1 = props.color; + // console.log("is spinner visible: ", visible); + return ( + //
+
+
+ + {text} + +
+ ); +} + +export default Spinner; + +``` + +Spinner.scss +```scss +.none { + display: none; +} + +.spinner .Loading_Text { + font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; +} + +.spinner { + border: 8px solid #f3f3f3; + border-top: 8px solid #000000; + border-radius: 50%; + width: 50px; + height: 50px; + animation: spin 1s linear infinite; +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +.spinnerStyle { + display: "flex"; + justify-content: "center"; + align-items: "center"; +} + +``` + +- Creating pill shaped button + + ```css + .proceed { + margin-top: 1rem; + color: white; + background-color: black; + border: none; + border-radius: 9999px; + padding: 1rem 0.5rem + } + ``` + + set border radius as very long size + + Output: + + ![Untitled](../../_resources/Untitled%201-2.png) + +- scroll to specific position with anchor tag + + +- aspect-ratio + + ![Untitled](../../_resources/Untitled%202-2.png) + +- whitespace property + + ![Untitled](../../_resources/Untitled%203-1.png) + +- calc() + + ## CSS only Approach (If height is known/fixed) + + When you want the middle element to span across entire page vertically, you can use `[calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc)` which is introduced in CSS3. + + Assuming we have a *fixed height* `header` and `footer` elements and we want the `section` tag to take entire available vertical height... + + **[Demo](http://jsfiddle.net/WdrDH/)** + + **Assumed markup** and your CSS should be + + ```css + html, + body { + height: 100%; + } + + header { + height: 100px; + background: grey; + } + + section { + height: calc(100% - (100px + 150px)); + /* Adding 100px of header and 150px of footer */ + background: tomato; + } + + footer { + height: 150px; + background-color: blue; + } + ``` + + ```html +
100px
+
Expand me for remaining space
+
150px
+ ``` + +- centralising div + + ![Untitled](../../_resources/Untitled%204-1.png) + + Ref: + + [https://www.youtube.com/watch?v=HOM47v73yG8&list=PLBOEc6PNYgCQZl3gDUDtv034yz-kwWkFo&index=3&t=200s](https://www.youtube.com/watch?v=HOM47v73yG8&list=PLBOEc6PNYgCQZl3gDUDtv034yz-kwWkFo&index=3&t=200s) + + [https://www.youtube.com/watch?v=HOM47v73yG8&list=PLBOEc6PNYgCQZl3gDUDtv034yz-kwWkFo&index=3&t=200s](https://www.youtube.com/watch?v=HOM47v73yG8&list=PLBOEc6PNYgCQZl3gDUDtv034yz-kwWkFo&index=3&t=200s) + + when using this method to centralize div, when we decrease screen height then div can go out of screen. To prevent this, use position absolute and + +- For setting dark theme + + We need to invert all colors of the page. + + ```html +
+ hello +
>> chr(65) + 'A' + >>> chr(120) + 'x' + >>> chr(ord('S') + 1) + 'T' + ``` + +- ASCII table + + ``` + Dec Char Dec Char Dec Char Dec Char + --------- --------- --------- ---------- + 0 NUL (null) 32 SPACE 64 @ 96 ` + 1 SOH (start of heading) 33 ! 65 A 97 a + 2 STX (start of text) 34 " 66 B 98 b + 3 ETX (end of text) 35 # 67 C 99 c + 4 EOT (end of transmission) 36 $ 68 D 100 d + 5 ENQ (enquiry) 37 % 69 E 101 e + 6 ACK (acknowledge) 38 & 70 F 102 f + 7 BEL (bell) 39 ' 71 G 103 g + 8 BS (backspace) 40 ( 72 H 104 h + 9 TAB (horizontal tab) 41 ) 73 I 105 i + 10 LF (NL line feed, new line) 42 * 74 J 106 j + 11 VT (vertical tab) 43 + 75 K 107 k + 12 FF (NP form feed, new page) 44 , 76 L 108 l + 13 CR (carriage return) 45 - 77 M 109 m + 14 SO (shift out) 46 . 78 N 110 n + 15 SI (shift in) 47 / 79 O 111 o + 16 DLE (data link escape) 48 0 80 P 112 p + 17 DC1 (device control 1) 49 1 81 Q 113 q + 18 DC2 (device control 2) 50 2 82 R 114 r + 19 DC3 (device control 3) 51 3 83 S 115 s + 20 DC4 (device control 4) 52 4 84 T 116 t + 21 NAK (negative acknowledge) 53 5 85 U 117 u + 22 SYN (synchronous idle) 54 6 86 V 118 v + 23 ETB (end of trans. block) 55 7 87 W 119 w + 24 CAN (cancel) 56 8 88 X 120 x + 25 EM (end of medium) 57 9 89 Y 121 y + 26 SUB (substitute) 58 : 90 Z 122 z + 27 ESC (escape) 59 ; 91 [ 123 { + 28 FS (file separator) 60 < 92 \ 124 | + 29 GS (group separator) 61 = 93 ] 125 } + 30 RS (record separator) 62 > 94 ^ 126 ~ + 31 US (unit separator) 63 ? 95 _ 127 DEL + + ``` + +- Transfer files from pc to emulator + + [adb push C:\\MyFiles\\fileName.txt /sdcard/fileName.txt](https://i.stack.imgur.com/NBFto.png) + +- Spotify playlist + + https://developer.spotify.com/documentation/web-api/reference/#/operations/get-playlist + + video: [https://www.youtube.com/watch?v=0dmS0He\_czs](https://www.youtube.com/watch?v=0dmS0He_czs) + + +https://www.sohamkamani.com/nodejs/rsa-encryption/ + +- Non microsoft vscode ie VsCodium + + C:\\Users\\h.vscode\\extensions : contains extensions for vs code + + C:\\Users\\h.vscode-oss\\extensions: contains extension for vscodium + + here h is username + + Not all extensions are available so just transfer extensions from vs code to vscodium manually. + + use package manager to install vscodium. + + for windows use: + + `winget install vscodium` + + - comments + + [@Existentialist](https://www.youtube.com/channel/UC_TYtMoJqI6gNOXIaVFfjtg)  + There is a trick for that. I have both vscode and vscodium installed. If desired extension is not avaiable in vscodium extension store then i download it from vscode store and copy its folder from .vscode/extensions to .vscode-oss/extensions. + +- Multiple vs code + + https://stackoverflow.com/questions/68047117/how-to-install-two-vs-code + + changing extension directory: + + https://stackoverflow.com/questions/40080793/is-there-a-way-to-change-the-extensions-folder-location-for-visual-studio-code + + What I did - after installing Visual Studio Code for the first time, I checked the documentation and added at the end of 'Target' field of editor's shortcut the following (there's a space before the two dashes): + + ```bash + --extensions-dir="DRIVELETTER:\VSCODE\extensions" + --user-data-dir="DRIVELETTER:\VSCODE\settings" + + ``` + + where DRIVERLETTER and VSCODE are the corresponding drive and directory where Visual Studio Code is installed. So mine looks like this: + + ```bash + "D:\Microsoft VS Code\Code.exe" --extensions-dir="D:\Microsoft VS Code\extensions" + + ``` + + Here is for the user data directory: + + ```bash + "D:\Microsoft VS Code\Code.exe" --user-data-dir="D:\Microsoft VS Code\settings" + + ``` + + Accessing the 'Target' field is done by right-clicking the shortcut and choosing 'Properties' + + Anyway, there's a simpler solution to that problem - just use the portable version of Visual Studio Code. It works under Windows, Linux, and macOS: + + for windows: + + ```powershell + @START codium --extensions-dir="C:\Users\hp\Videos\imp\web\extensions" --user-data-dir="C:\Users\hp\Videos\imp\web\User" + ``` + +- Chromium archive builds + + https://src.chromium.org/viewvc/chrome/releases/1.0.154.53/src/ + + older executable: https://vikyd.github.io/download-chromium-history-version/#/ + +- Cloud Storage APIs + + [https://www.reddit.com/r/Python/comments/gm3irp/did\_anyone\_upload\_files\_to\_degoo\_cloud\_via/](https://www.reddit.com/r/Python/comments/gm3irp/did_anyone_upload_files_to_degoo_cloud_via/) + + LBRY: video streaming based on blockchain + +- Enable usb debugging on android + + \*\*\*\*Go to the Setting tab + + **Step 2:** Go to About Phone + + **Step 3:** Click several times on Build number + + **Step 4:** You will then get a pop-up message that reads "You are under developer mode" + + **Step 5:** Go back to Settings + + **Step 6:** Click on Developer options + + **Step 7:** Then check "USB debugging" + +- Permanent deletion of files in android + + With the increasing cases of identity theft and data breaches, it is certainly important to know the right way to dispose our data. Well, if you want to permanently delete your photos and videos from your phone, then I would recommend the following solutions. + + **Delete media files manually** + + Well, the easiest solution would be deleting your photos and videos manually from your device. Just go to the Gallery app and select what you wish to get rid of. Afterward, make sure that you visit the “Recently Deletedâ€� album where your photos are saved temporarily. Now, delete your photos from here as well to remove them permanently. + + **Factory Reset your Device** + + If you want to permanently delete everything from your phone, then consider performing a factory reset. If you have an iPhone, then just go to its Settings > General > Reset for this while Android users can find it in Settings > Reset as well. This will erase not just photos, but all the saved content and stored settings from your phone. + + **Use a Professional Data Eraser** + + If you just factory reset or manually delete your photos, then anyone can extract them using a data recovery tool. Therefore, if you are concerned about your privacy, then consider using dr.fone – Data Eraser. There are dedicated applications for both iOS and Android that you can try. Using them, you can connect your device, and follow a simple click-through process to completely wipe your data. This will erase all your photos and videos beyond the scope of recovery. + +- Block installation + + 0 + + MacroDroid [here](https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid) can save u: Let's be simple; + + 1. Download and install MacroDroid + 2. Press Add Macro + 3. Select Trigger to be Application Launched + 4. Check non-launchable apps + 5. Locate Package installer and select it + 6. Go to Actions tab + 7. Select Launch Home Screen + 8. Go to constraints and chose any other thing you want it to consider before executing that action you configured above or just leave it blank + 9. Give your Macro a name and save it + 10. You're ready to go + + Note: *give macrodroid all permissions possible as requested. The macro will look as below* + + ![https://i.stack.imgur.com/sbe5S.jpg](https://i.stack.imgur.com/sbe5S.jpg) + +- Google search hacks + + https://news.ycombinator.com/item?id=25371017 + +- better third party upload api + + https://app.uploadcare.com/ + +- ytdl core nodejs + + https://medium.com/@Moorad/how-i-made-my-own-youtube-downloader-using-javascript-and-node-js-160b172f6e10 + +- Merge audio nd video in browser + + https://www.youtube.com/watch?v=UXxv8-xtwNc + +- Create custom video downloader + + https://javascript.plainenglish.io/make-your-own-youtube-downloader-626133572429 + +- Stream downloads + + https://philna.sh/blog/2020/08/06/how-to-stream-file-downloads-in-Node-js-with-got/ + +- remote url download like google drive + + pcloud + + https://gofile.io/ have api option too + + fileLu : closed file system upload + + [fileLu](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Extras%2052e0285b6a994018ba3a68c7c33ca3de/fileLu%206e31d221398d43638829e010f1ae9272.md) + + filebin.net: open file system upload + + - Moralis IPFS + + https://docs.moralis.io/web3-data-api/evm/reference/upload-folder + + https://moralis.io/pricing/#0 + + + Internet archive + + https://www.sitelike.org/similar/gofile.io/ + + https://workupload.com/ + + +[macros](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Extras%2052e0285b6a994018ba3a68c7c33ca3de/macros%20bca37d848db740deab4c5801bd1eef18.md) + +[youtube stream itags](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Extras%2052e0285b6a994018ba3a68c7c33ca3de/youtube%20stream%20itags%20be99980f6ca34db5abde5ac77495b.md) + +- redis caching nodejs + + https://www.digitalocean.com/community/tutorials/how-to-implement-caching-in-node-js-using-redis + + https://www.sitepoint.com/using-redis-node-js/ + + +  + +- CORS proxy + + proxy.cors.sh + + whateverorigin.org + + ```jsx + fetch("https://proxy.cors.sh/https://acme.com", { + headers: { + "x-cors-api-key": "temp_6ed182fc89f2d7dc756368139fed3299", + }, + }); + + const proxy = "https://proxy.cors.sh"; + const key = "temp_6ed182fc89f2d7dc756368139fed3299"; + + const res = await fetch( + `http://www.whateverorigin.org/get?url=http://www.google.com` + ); + ``` + +- github api + + https://api.github.com/users/kroeckx: for getting user info from username + + https://api.github.com/search/users?q=kurt@roeckx.be : getting username from email address if public + +- Script to copy project excluding node\_modules + + ```jsx + const fs=require('fs') + const path=require('path') + + const copyFiles=(folder,folderPath)=> + { + const fileregex=/.+\..+/ + const files=fs.readdirSync(folderPath) + console.log('files: ',files) + for(let file of files) + { + const filePath=`${folderPath}/${file}` + const destinationFilePath=filePath.replace(__dirname,`${__dirname}_copy`) + const destinationFolderPath=folderPath.replace(__dirname,`${__dirname}_copy`) + + if(file==='node_modules'||file==='audios'||file==='songs') + { + continue; + } + + if(fs.lstatSync(filePath).isDirectory() ) + { + copyFiles(file,filePath) + } + + + console.log(filePath,destinationFilePath) + fs.mkdirSync(destinationFolderPath,{recursive: true}) + + if(!fs.lstatSync(filePath).isDirectory() ) + { + const dataFile=fs.readFileSync(filePath) + fs.writeFileSync(destinationFilePath,dataFile) + } + + } + } + + copyFiles(__dirname,`${__dirname}`) + ``` + +- Cheerio features + + loop over elements: + + ```jsx + import fetch from 'node-fetch'; + import { load } from 'cheerio'; + + const url = 'http://webcode.me/countries.html' + + const response = await fetch(url); + const body = await response.text(); + + let $ = load(body); + + $('tr').each((_, e) => { + + let row = $(e).text().replace(/(\s+)/g, ' '); + console.log(`${row}`); + }); + ``` + +- Extracting youtube id + + `let regex=/watch\?v=([a-zA-Z0-9_-]+)[&]?/` + +- deta features + + ![Untitled](../../_resources/Untitled-7.png) + +- yt download Links + + https://x2download.app/en48 + + https://wave.video/convert/youtube-to-mp4 + + https://ssyoutube.youtubemini.com/#url=https://www.youtube.com/watch?v=X3jw1JVNdPE + +- New way to download audio from youtube after throttling + + ```jsx + const getAudioLink = async (url) => { + const info = await ytdl.getInfo(url); + + + const { formats } = info; + const title = info.videoDetails.title; + + const getDownloadLinkByItag = (formats, itag) => { + const formatObj = formats.find((format) => format.itag === Number(itag)); + if (formatObj.itag === 140) { + return { url: formatObj.url, cL: formatObj.contentLength }; + } + return formatObj.url; + }; + + const itag = "140"; + let dobj = getDownloadLinkByItag(formats, itag); + let dURL = dobj.url; + const end = dobj.cL; + dURL = dURL + `&title=${encodeURIComponent(title)}&range=0-${end}`; + + console.log("audio durl: ", dURL); + + const urlDown = await tiny.shorten(dURL); + // const urlDown = dURL; + + return { urlDown, title }; + + // const format2 = ytdl.chooseFormat(info.formats, { quality: `140` }); + // console.log("🚀 ~ file: app.js ~ line 54 ~ app.post ~ format2", format2); + + // try { + // // ytdl.downloadFromInfo(format).pipe(fs.createWriteStream("video.mp4")); + // const audio = ytdl(url, { + // filter: (format) => { + // // format1.container === "mp4" && format1.hasAudio === true, + // // console.log("🚀 ~ file: app.js ~ line 33 ~ app.post ~ format1", format1); + + // return isEqual(format, format2); + // }, + // }); + + // return audio; + // } catch (err) { + // console.log(err); + // throw new Error(err.toString()); + // } + }; + ``` + +- Logger for js + + https://stackoverflow.com/questions/41232578/node-js-console-log-in-txt-file + + https://www.npmjs.com/package/log4js + + ```jsx + var log4js = require("log4js"); + var logger = log4js.getLogger(); + logger.level = "debug"; + logger.debug("Some debug messages"); + ``` + +- upload file to ipfs nodejs + + https://portal.thirdweb.com/api-keys?ref=blog.thirdweb.com + + ```jsx + const { ThirdwebStorage } = require("@thirdweb-dev/storage"); + + const fs = require("fs"); + + const storage = new ThirdwebStorage({ + secretKey: "YOUR_SECRET_KEY", // You can get one from dashboard settings + }); + + const ipFsUpload = async (titles) => { + // const upload = await storage.upload({ + // metadata: { name: "ghu.mp3" }, + // alwaysUpload: true, + // }); + + const buffers = titles.map((title) => fs.readFileSync(`music/${title}.mp3`)); + // const uploads = await storage.uploadBatch([ + // fs.readFileSync("Holiday_Boulevard_of_Broken_Dreams.mp3"), + // fs.readFileSync("test.txt"), + // ]); + + const uploads = await storage.uploadBatch(buffers); + // const upload = await storage.upload({ + // name: "gh.mp3", + // file: fs.readFileSync("test.txt"), + // }); + + // const gatewayURLS = uploads.map((upload) => storage.resolveScheme(upload)); + const gatewayURLS = []; + + for (let i = 0; i < uploads.length; i++) { + const upload = uploads[i]; + const title = titles[i]; + + const gatewayURL = storage.resolveScheme(upload); + + const obj = { url: gatewayURL, title }; + gatewayURLS.push(obj); + } + + console.log("gateway urls: ", gatewayURLS); + + return gatewayURLS; + + // console.log(`Gateway URL - ${storage.resolveScheme(upload[0])}`); + }; + + module.exports = { ipFsUpload }; + ``` + +- Clarifai api march 2023 + + ```jsx + const raw = JSON.stringify({ + "user_app_id": { + "user_id": "clarifai", + "app_id": "main" + }, + "inputs": [ + { + "data": { + "image": { + "url": "IMAGE_URL", + "base64": "base64_string" + } + } + } + ] + }); + + const requestOptions = { + method: 'POST', + headers: { + 'Accept': 'application/json', + 'Authorization': 'Key ' + 'your key' + }, + body: raw + }; + + // NOTE: MODEL_VERSION_ID is optional, you can also call prediction with the MODEL_ID only + // https://api.clarifai.com/v2/models/{YOUR_MODEL_ID}/outputs + // this will default to the latest version_id + + fetch(`https://api.clarifai.com/v2/models/face-detection/versions/6dc7e46bc9124c5c8824be4822abe105/outputs`, requestOptions) + .then(response => response.text()) + .then(result => console.log(result)) + .catch(error => console.log('error', error)); + ``` + + +https://www.markdowntutorial.com/ + +- youtube search without api + + https://www.npmjs.com/package/scrape-youtube + +- Remove constant popup of winrar for free + + [WinRAR crack.rar](../../_resources/WinRAR_crack.rar) + + just add a rarreg.key file in winrar folder + +- insert html at caret in contenteditable element + + ```jsx + function pasteHtmlAtCaret(html) { + var sel, range; + if (window.getSelection) { + // IE9 and non-IE + sel = window.getSelection(); + if (sel.getRangeAt && sel.rangeCount) { + // get selected area details + range = sel.getRangeAt(0); + + //deleting the selected region + range.deleteContents(); + + // Range.createContextualFragment() would be useful here but is + // non-standard and not supported in all browsers (IE9, for one) + var el = document.createElement("div"); + el.innerHTML = html; + + // offscreen dom tree creation as inserted between instead of last + var frag = document.createDocumentFragment(), + node, + lastNode; + + // extract elements from div container and appending it to document fragment + while ((node = el.firstChild)) { + lastNode = frag.appendChild(node); + } + + range.insertNode(frag); + + // Preserve the selection + if (lastNode) { + // range = range.cloneRange(); + + // to unselect and push caret to last + range.setStartAfter(lastNode); + range.collapse(true); + + // if not removed then cursor wont be at last + sel.removeAllRanges(); + sel.addRange(range); + } + } + } else if (document.selection && document.selection.type != "Control") { + // IE < 9 + document.selection.createRange().pasteHTML(html); + } + } + ``` + +- Fix com surrogate high memory usage + + https://www.youtube.com/watch?v=YXhB3eNk9I8 + https://small.fileditchstuff.me/s5/qIZWhbEWyHBvWUgpdrLO.mp4 + +- onchange event attribute in html + + ```jsx + function create_comboA(your_Object) { + + var my_value = your_Object.my_value; + + console.log(my_value); + + } + + + ``` + + here this is equivalent to e.target + + event is equivalent to e + +- Simple connection + + ```html + + + + + + + + Document + + + + + + + ``` + + ```jsx + const handleChange = (e) => { + let str = e.value; + console.log("str: ", str); + fetch("/send", { + method: "post", + body: JSON.stringify({ text: str }), + headers: { + "content-type": "application/json", + // accept: "Application/octet-stream", + }, + }); + }; + ``` + + ```jsx + const express = require("express"); + + const app = express(); + + app.use(express.static(__dirname + "/public")); + app.use(express.json()); + + app.post("/send", (req, res) => { + const { text } = req.body; + console.log(text); + }); + + app.listen(3000, () => { + console.log("listening"); + }); + ``` + +- Sublime Text Palenight theme missing fix + + The Palenight theme is not included in the Midnight theme package. You need to install the Palenight theme separately. You can do this by following these steps: + + 1. Open Sublime Text and go to **Preferences > Browse Packages**. + 2. In the Packages directory, create a new folder called `Palenight`. + 3. Clone the Palenight theme repository: https://github.com/jbrooksuk/palenight-sublime-text into the `Palenight` folder. + 4. Restart Sublime Text. + + The Palenight theme should now be available in the **Color Scheme** menu. + + Here are some additional troubleshooting steps you can try if the Palenight theme is still not available: + + - Make sure that you have installed the latest version of the Palenight theme. + - Verify that the `Palenight` folder is located in the `Packages` directory. + - Restart Sublime Text multiple times. + - Clear your Sublime Text settings. +- Docker + + https://medium.com/swlh/containerize-your-personal-projects-with-docker-fe62ca391db8 + + ![Untitled](../../_resources/Untitled%201-4.png) + + Dockerfile saved with name ‘Dockerfile’ no extension + + ```docker + FROM node:12 + + WORKDIR /app + + COPY package*.json ./ + + RUN npm install + + COPY . . + + ENV PORT=8080 + + EXPOSE 8080 + + CMD [ "npm","start" ] + ``` + + just like .gitignore there is a file name .dockerignore to exclude mentioned files or folder + + ```docker + node_modules + ``` + + building image: + + `docker build -t username/first_app:1.0` + + it will produce an output and will produce image starting with sha…… + + To run the image use: + `docker run ` + + Now if we try to run it with port(here in eg port is 8080) then it wont run because by default its not accessible outside container so to expose it we can use port forwarding. + + `docker run -p 5000:8080 ` + + port 8080 of container is forwarded to port 5000 of outside container. 5000:8080 is mapping + + - For publishing + + Now login through the CLI by executing: + + ``` + docker login + ``` + + Push your Docker Image to the Docker Hub repository with the following command: + + ``` + docker image push /: + ``` + + Example: + + ``` + docker image push dhanushkamath/dockerize-node:1.0.0 + ``` + + You’ve successfully published your first image to the world! + + Running this container on a different computer that has Docker only requires a single command: + + ``` + docker run dhanushkamath/dockerize-node:1.0.0 + ``` + +- RSA + + https://www.geeksforgeeks.org/rsa-algorithm-cryptography/ + + Note: If your public key's n (modulo) is 4096 bits, then your message can't exceed 4096 bits (realistically even less because of padding) + + ``` + Select two prime no's. Suppose + P = 53 and Q = 59. + Now First part of the Public key : n = P*Q = 3127. + + ``` + + ``` + But e Must be An integer.Not be a factor of Φ(n). 1 < e <Φ(n) + Φ(n) = (P-1)(Q-1) + so, Φ(n) = 3016 + Eg: For e=3, Φ(n)%e !=0 so e is not factor of Φ(n). + ``` + + ``` + Now calculate Private Key,d + d = (k*Φ(n) + 1) / e for some integer k + + or + + D*e mod φ (n) = 1 + at k=2, + (2*3016+1)/3 =( 6032+1)/3=6033/3= 2011 + d=2011 + ``` + + Public Key= <e,n> = <3,3127> + + Private Key=<d,n> <2011,3127> + + Encryption: + + (m^e)mod(n) here a mod b = a%b ⇒ mod is modulus operator + + m=3 + + (3^3)%3127=27%3127=27 + + c=27 + + Decryption: + + **(c^d)mod n** + + 27^2011 % 3127 + + - Complex calculation + + https://www.youtube.com/watch?v=EiZGCSsKtfM + + https://stackoverflow.com/questions/45381402/rsa-exponent-size + + - Stack overflow + + Let's say `M` is the modulus. So YES, you could first perform `intermediate = 65^e`, and finally compute `intermediate mod M`. And of course, `intermediate` would be a very very very very big integer (if `e` equals 65537, the decimal representation of `intermediate` contains 118813 digits!). + + BUT, **thanks to a very basic modular arithmetic theorem**, + + ``` + (65^e) mod M = ((((65 mod M) * 65) mod M) * 65) mod M [...] (e times) + + ``` + + (*the theorem states that in a quotient ring, the n-th power of the class of an element is the class of the n-th power of the element*) + + As you can see, this does not need any very big integer library, since after each arithmetic product, you use `mod M` that returns an integer between `0` and `M-1`. So, you only have to compute arithmetic products of integers less than M. + + As an example, here is a simple shell script (bash) that computes 65^65537 mod 991\*997. **As you can see, no need to get a big number library:** + + ``` + #!/bin/bash + + # set RSA parameters + m=65 # message to encode + M=$((991*997)) # modulus (both 991 and 997 are prime numbers) + e=65537 # public exponent (coprime with 990*996, thus compliant with RSA algorithm) + + # compute (m^e) mod M + ret=1 + for i in {1..$e} + do + ret=$(((ret*m)%M)) + done + + # display the result + echo $ret + + ``` + + It immediately returns `784933`, thus `65^65537 mod 991*997 = 784933` + + The biggest integer computed with your method of calculus has 118813 digits, but the biggest integer handled with this shell script only has 12 or less digits (`(M-1)^2` is made of 12 digits). + + **According to these explanations, we can now answer your question:** + + > My question is then, for the working RSA algorithm, what size (number of digits) number does that algorithm pick? + + With the above explanations, you can see that the maximum number of digits in the decimal representation of integers you have to manipulate is `1+log10((M-1)^2)`, because you will, at most, compute a product of two integers between `0` and `M-1`. + + Note that `1+log10((M-1)^2) = 1+2.log10(M-1) < 2+2.log10(M) = 2.(1+log10(M))`. Also note that `1+log10(M)` is the number of digits of M. + + Therefore, as a conclusion, this proves that **the number of digits your library has to handle correctly is twice the number of digits of the modulus** (if you are computing the exponentiation using integer multiplications the way explained here). + + + **Calculate Large Exponents** + + Calculating large exponents and modular arithmetic can be complex. For such calculations, you can use a calculator or programming language with built-in support for handling large numbers and modular arithmetic. In this case, you're looking to calculate 56^{2346} \\mod 564562346mod564. + If you want to do this using a programming language like Python, you can use the **`pow()`** function along with the modulus operator **`%`**: + + `pythonCopy coderesult = pow(56, 2346, 564) print(result)` + + If you don't have access to programming tools, you might need to use a calculator that supports large number calculations and modular arithmetic. Many scientific calculators and online calculator tools have this capability. Just make sure to enter the values and operations correctly. + Keep in mind that the result will be a large number, so ensure you're using tools that can handle such calculations accurately.I mean arent there any mathematical properties to handle thisChatGPT + Yes, there are mathematical properties that can help simplify and handle calculations involving large exponents and modular arithmetic. One property that's particularly useful is the **modular exponentiation** property. This property states that for any positive integers a*a*, b*b*, and m*m*, you can compute a^b \\mod m*ab*mod*m* efficiently without actually calculating the huge exponentiation. + + Here's the general idea: + + 1. Start with a result variable initialized to 1. + 2. Iterate through the binary representation of b*b*, from the least significant bit to the most significant bit. + 3. For each bit, if it's 1, multiply the result by a*a* and take the result modulo m*m*. + 4. Square a*a* and take the result modulo m*m* in each iteration. + 5. The final result will be a^b \\mod m*ab*mod*m*. + This method significantly reduces the number of multiplications and calculations required compared to naively calculating a^b*ab* and then taking the modulus. + For example, to calculate 56^{2346} \\mod 564562346mod564, you would apply the above steps using a = 56*a*\=56, b = 2346*b*\=2346, and m = 564*m*\=564. + However, this approach still involves some complex calculations. If you're not comfortable performing these calculations manually, it's best to use a programming language or calculator with built-in support for modular exponentiation.Ok so use these steps to solve this ChatGPT + + * * * + + Main: + + Certainly! Let's use the modular exponentiation property to calculate 56^{2346} \\mod 564562346mod564: + + 1. Start with the result variable res = 1*res*\=1. + 2. Convert the exponent 2346 to binary: 2346\_{10} = 100100101010\_{2}234610=1001001010102. + 3. Iterate through the binary representation of the exponent: + â—¦ First bit: 00. Square 56 and take the result modulo 564. + â—¦ Second bit: 11. Multiply 56 by 56, take the result modulo 564, and then square the result. + â—¦ Third bit: 00. Square the result again. + â—¦ ... + 4. After iterating through all bits, the final result will be res = 56^{2346} mod 564 + Using the steps above, you can perform the calculations iteratively: + 5. res = 1 + 6. res = 56^2 mod 564 = 3136 mod 564 = 220 + 7. res = 220 \* 56^2 mod 564 = 220 \* 3136 mod 564 = 4476 mod 564 = 348 + 8. ... (continue squaring and multiplying as per the binary representation of the exponent) + After completing all the steps, the final result res will be the value of 56^{2346} mod 564 + + * * * + + Taking another example: + + 2^9 mod 100 + + 9=1001 in binary form + + res=1 + + If bit is: + + 1: multiply by base which is 2 here ⇒ res\*2 + + 0: square it ⇒ res^2 + + from right to left: + + First significant bit(rightmost) ie 1: res=res\*2 mod 100=2 mod 100 = 2 + + 2nd bit ie 0: res=res^2=4 mod 100 = 4 + + 3rd bit ie 0. res=res^2= 4\*4=16 mod 100 = 16 + +- YouTube alternative + + Invidious + + libreddit + +- To learn + + Non free js/ librejs + + Floorp Firefox engine browser like vivaldi + + Midori + +- Cons of matlab + + 1: index starts at 1. + + 2: % is not recognized as modulus. rem function has to be used. + + 3; Ambiguous syntax + + https://www.rath.org/matlab-is-a-terrible-programming-language.html + +- Browsers + + Librewolf + + Mullwad : tor without tor network + + waterfox + + Falkon + + midori + +- Email + https://eylenburg.github.io/cloud_comparison.htm + skiff (2021-2024) + + disroot : https://disroot.org/en/services/email + + tutanota(now called tuta) (since 2016) (6 months of inactivity) + https://www.reddit.com/r/PrivacyGuides/comments/v2v6rw/email_provider_recommendations_free_imappop/ + abv bg : bulgariian email service + https://www.fsf.org/resources/webmail-systems : free emails + https://veilmail.io/ : generate alias for email + https://app.simplelogin.io/ : to create alias for proton mail (upto 10 alias) + https://app.addy.io/register : upto 10 + firefox relay (alias service) : cant generate custom alias though + https://www.techradar.com/pro/free-email-accounts-listed-and-compared + like vielmail there are Blur and 33mail + zoho : (since 2008) (needs phone number) + proton (since 2014) + gmail (since 2004) + riseup(since 1999) + mail.com(need usa or europe IP, also need valid phone number) + ctemplar(2019-2022) + aol(needs local phone number), similarly Daum Mail , naver mail and yandex mail + mailfence(7 months of inactivity) + onmail : (since 2020 -2025) + rmail (since 2022) + mailo + aster mail (since apr 2026) + atomic mail (subce 2024) + autistici/inventi (2001-2026) + adminforge + infomaniak (need phone number verification by reverse calling) + https://keepitfree.ai/it/announcements/a/i-chiude-restare-umani/ + [A_I Closes Stay Human · Keep the Internet free (15_9_2026 12:00:45 pm).html](../../_resources/A_I%20Closes%20Stay%20Human%20·%20Keep%20the%20Internet%20free%20%2815.html) + +   + email client: + thunderbird + fairemail: for android +   + smtp providers + https://mailtrap.io/blog/free-smtp-servers/ + mailgun (to 5 users only, 5k/month) + sendgrid (1k/month) + brevo(need phone number and cant be verified with temp ones,also address) + smtp2go(1k/month, need private domain) + sendpulse(12k/month) + blogmail : requires domain + mailtrap : requires domain(3k/month) + mailsend(1k/month) (provides u with your temporary domain) + elastic email (100/day) + + https://elasticemail.com/developers/api-documentation/rest-api#section/Authentication + + + +- Search engine + + duckduckgo + + startpage : [https://www.startpage.com](https://www.startpage.com/) + qwant.com (not availble in india though) + brave search + ecosia (google and bing result) : does tracked by google though + https://altpower.app + searxing : https://priv.au (instance), https://www.gruble.de/ + https://degoog.org/ + + +- Mirrors + + https://github.com/mendel5/alternative-front-ends + + https://mike.sg/2022/07/10/how-to-use-libredirect-on-android/ + + libreddit https://libreddit.northboot.xyz/ : read-only + + Teddit + + whoogle: https://whoogle-search--replitcomreside.repl.co/, google + + searx, weird one : for unbiased search result : https://searx.work/ + + https://github.com/benbusby/whoogle-search#public-instances + + Nitter: read only for twitter + + https://github.com/libreddit/libreddit-instances/blob/master/instances.md + + invidous: yewtu.be + + simple translate, lingwa translate + + libremd: imdb mirror + + quetre : quora mirror + + rimgo: imgur mirror https://rimgo.kling.gg/ + +- VPN + + hide me + + windscribe + + https://www.vpngate.net/en + + riseup : need invite codes for email but for vpn it needs snapd + + atlas + + cloudfare dns + +- Download page + + singlefile extension + + - chrome + + [SingleFile.zip](../../_resources/SingleFile.zip) + + [SingleFile.crx](../../_resources/SingleFile.crx) + + - firefox + + [green day - Invidious (8\_26\_2023 7\_11\_16 AM).html](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Extras%2052e0285b6a994018ba3a68c7c33ca3de/green_day_-_Invidious_%288_26_2023_7_11_16_AM%29.html) + + [single\_file-1.21.62.rar](../../_resources/single_file-1.21.62.rar) + +- Coral + + https://coral-sim.zybooks.com/ + + it shows execution for code in animation and draws flowchart itself + +- spotify recorder + + spy-spotify : spytify software + +- Virtual box resolution fixing + + ![Untitled](../../_resources/Untitled%202-3.png) + + ```bash + xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync + + xrandr --addmode Virtual1 1920x1080 + xrandr --output Virtual1 --mode 1920x1080 + ``` + +- Mobile browser with extension support + + Lemur browser : chromium based closed source + + kiwi : chromium based closed source + + firefox : open source + + yandex : russian chromiium based + +- Video/image upload + + | name | allows variety | anon uploads | direct links | galleries | gifs | mp4s | popups | upload limit | + | --- | --- | --- | --- | --- | --- | --- | --- | --- | + | catbox.moe | yes | yes | yes | yes | yes | yes | yes | 200 mb, (Gif 20 mb) | + | freeimage.host | yes | yes | yes | yes | yes | no | no | 64 mb | + | imgbox.com | yes | yes | yes | yes | yes | no | yes | 10 mb | + | imgchest.com | yes | yes | yes | yes | yes | no | no | 20 mb | + | lensdump.com | yes | no | yes | yes | yes | no | no | 100 mb | + | pixhost.to | yes | yes | yes | yes | yes | no | no | 10 mb | + | postimages.org | yes | yes | yes | yes | yes | no | no | 24 mb | + | redgifs.com | yes | no | no | yes | yes | yes | yes | 1 gb | + | steamysnap.com | yes | no | yes | yes | yes | no | no | 20MB | + | sdrive.app | yes | yes | yes | coming | yes | yes | yes | 50MB | + + ![4b21323fadde3da88a58fa1efe8b2074.png](../../_resources/4b21323fadde3da88a58fa1efe8b2074.png) + + https://sendvid.com/ + + https://rapidshare.io/ + + https://easyupload.io/ + + filebin : deletes after 6 days + + https://fastupload.io/en + + goFile : file deletes if no one download it + + goFile unofficial download: https://gist.github.com/shawnli87/d416b7c9030293cabfcf4c225cdc5a15 + + skiff drive : https://app.skiff.com/drive/folder : no longer exist + + pcloud + + filen.io : if not login in 3 months, file may get deleted + fileLU : file may get deleted later + + idrive : with file sync cross platform : no longer free + + dropbox : with file sync cross platform + + sync : with file sync cross platform except linux + + https://buzzheavier.com/ (unlimited, forever, no ddl link by default) + + jottacloud : 5GB + https://drime.cloud/ : 20 gb free eu hosting + filegarden : https://filegarden.com/ : 100mb file limit, 2gb total limit, ddl link + https://mobidrive.com : 20gb free storage +filespayout : 10gb free but with 10s wait for download + blackbaze : 10gb s3 like cloud storage https://www.backblaze.com : no public link without credit card + cloudfare r2 : s3 like, requires credit card + https://filebase.com/pricing/ : 5gb storage with 5gb bandwidth + koofr : 10gb (share link expire after 14 days) + opendrive (5 GB | 100 MB Max File Size | 1 GB/Day Bandwidth 1 User | 200 KB/s Speed) (Supports DDL) + + box : with file sync cross platform except linux + + https://workupload.com/ + + https://www.cbackup.com (10gb, 1gb/day) + + for file sharing: https://0x0.st/, code: https://git.0x0.st/mia/0x0 + https://www.lifewire.com/free-cloud-storage-1356638 : free cloud storages + https://bytesbin.com/file-hosting-direct-download-link/ : free cloud storages with direct downloadable link + https://ddownload.eu : 5tb with 30 days validity + https://www.zotero.org/support/kb/webdav_services + 4shared : (15 gb, 3GB daily limit, 30GB monthly limit, need to sign i to download files) + scramble.cloud : 100 gb storage encrypted(some IP block it) + + https://vgy.me/ : for image + https://fileditch.com/ : 15gb/file perma storage + filen : 10gb vloud storage end to end encyption : will get 10 gb for inviting friends (3 months of inactivity) + dropbox : 500mb per referral + deegoo : 20gb + 1filchier : 1tb temp storage + yandex disk : 5gb + mega 20gb (since 2013) + mediafire : 10gb(1 gb for every friend invite)(since 2006) + bestfile(unlimited space, 5gb/file)(for unregistered, 1gb/file, 6months file validity) + uploadnow(100 gb, cant signin)(file deletes if no one download it) + blomp(20 gb to 200gb) + uloz.to : (1gb, no way to make files public/sharable) : reduced from 50gb to 25gb to 1gb + +- Google DRM Dangers + + 1. What will happen basically that google will decide that which browser, which OS, which extension u can use also forcing to use Cam and microphone + 2. So u can no longer block ads, extension to save our system from virus thus stealing your information and selling it. + Internet will no longer be open anymore. + 3. Get commerce sites, banks, and digital content providers to widely adopt WEI for security benefits. + 4. Require use of TPM signed OS to access said sites "securely". + 5. Only sign systems with locked down execution environment to ensure integrity of system. + 6. Censorship, spying, marketing and who knows what else. + 7. malicious websites can then filter out traffic they don't want, and instead focus entirely on their specified victims. + 8. search engine scrapers being unable to gather data. so no new search engine will ever develop. + 9. this may affect dissidents and journalists that use secure software (TAILS, tor, etc) to communicate sensitive information. said secure software would probably not succeed a WEI test, and could thus make their work even more difficult than it is + + Asking the user if they’d like to receive notifications the instant they visit a site is so dumb. As soon as the user hits no, that’s it, they’ve now been indefinitely banned from requesting that permission moving forward. Regardless of if the user might actually want it some day later on. + + Safetynet will detect rooted device and block its access for banking apps + + 1, don't worry this is just an idea + 2, don't worry this is just some personal project + 3, don't worry this is just an internal discussion + 4, don't worry this is just a closed test + 5, yaaaaaa you have to update or you'll die, byyyyy + + - chat + + It's a DRM to be launched by google giving websites access to our device information. + + https://m.youtube.com/watch?v=5joNRJ3C5ho&pp=ygUZU29tZW9yZGluYXJ5Z2FtaW5nIGdvb2dsZQ%3D%3D + + https://github.com/RupertBenWiser/Web-Environment-Integrity/blob/main/explainer.md + + ability for websites to detect your environment so that u can be trusted + +- Open source note taking + + https://www.youtube.com/watch?v=P8accXNcwjs + + qownnotes + + appflowy for notion + + anytype for notion + + joplin + + zimnotes : have option of exporting html but only for pc + + markor : for android + + nextcloud for office 365 + + mattermost for teams + + litexl for sublime text + + https://www.youtube.com/@VideosByDefault/about + +- Open source project + + Lime text : foss alternative of sublime text + + https://www.youtube.com/watch?v=oLrwk07zZ0Y + + vaultwarden : password manager + + padloc : password manager (stores data in `~/.local/share/app.padloc`) + + https://github.com/k0gen/agora-wrapper : fileHosting + + podman : docker alternative + + libretube : youtube mirror + + peer tube : youtube alternative . its french + + syncting : airdroid alternative + + https://blog.space-cloud.io/posts/top-5-opensource-heroku-alternatives/ + +- toggle list in markdown + + ```html +
Click me + + ### Heading + + 1. Foo + 2. Bar + - Baz + 3. [Window Tiling in XFCE.mp4](:/b1511aa80cad4d8398847045a03c96be) + + ### Some Javascript + + ```js + function logSomething(something) { + console.log('Something', something); + } + ``` + +
+ ``` + +- Joplin + + https://github.com/laurent22/joplin/blob/dev/BUILD.md \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/API 0f105a3694eb438f81f8f5406a27ad13.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/API 0f105a3694eb438f81f8f5406a27ad13.md new file mode 100644 index 0000000..a8c2cf8 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/API 0f105a3694eb438f81f8f5406a27ad13.md @@ -0,0 +1,3 @@ +# API + +"genius-lyrics-api": "^3.0.6", react \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/Untitled fb72486783cf4c7fae04c6b8182a65bb.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/Untitled fb72486783cf4c7fae04c6b8182a65bb.md new file mode 100644 index 0000000..4f9f41e --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/Untitled fb72486783cf4c7fae04c6b8182a65bb.md @@ -0,0 +1 @@ +# Untitled \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/fileLu 6e31d221398d43638829e010f1ae9272.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/fileLu 6e31d221398d43638829e010f1ae9272.md new file mode 100644 index 0000000..393f312 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/fileLu 6e31d221398d43638829e010f1ae9272.md @@ -0,0 +1,24 @@ +# fileLu + +```jsx +const HOST='https://filelu.com/api' +const FormData=require('form-data') +fetch(`${HOST}/upload/server?key=${key}`) +.then(res=>res.json()) +.then(data=>{ + const {sess_id,result}=data; + const formdata=new FormData() + formdata.append('sess_id',sess_id) + formdata.append('utype','prem') + formdata.append('file_0',file,'AliceinChainsThemBones2022Remaster.mp3') + + fetch(result,{ + method: 'post', + body: formdata + }) + .then(res=>res.json()) + .then(console.log) + .catch(console.log) +}) +.catch(console.log ) +``` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/green_day_-_Invidious_(8_26_2023_7_11_16_AM).html b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/green_day_-_Invidious_(8_26_2023_7_11_16_AM).html new file mode 100644 index 0000000..d072e37 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/green_day_-_Invidious_(8_26_2023_7_11_16_AM).html @@ -0,0 +1,1267 @@ + + +green day - Invidious + + + + + + + + +
+
+
+ + + +
+
Filters +
+ + +
+
Upload date
+
+
+
+
+
+
+
+
+
+
Type
+
+
+
+
+
+
+
+
+
+
Duration
+
+
+
+
+
+
+
+
Features
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sort By
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ + + + +
+ +
+
+ +

6,390,000 subscribers

+

0 videos

+
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

4:48

+
+
+ + +
+
+ +

Shared 10 years ago

+ +
+ +
+

745M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

1:56:52

+
+
+ + +
+
+ +

Shared 5 months ago

+ +
+ +
+

393K views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

3:13

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

326M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

5:26

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

505M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

3:03

+
+
+ + +
+
+ +

Shared 11 years ago

+ +
+ +
+

234M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

49:47

+
+
+ + +
+
+ +

Shared 3 years ago

+ +
+ +
+

2.7M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

7:13

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

210M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

2:58

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

118M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

2:32

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

91M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

4:42

+
+
+ + +
+
+ +

Shared 10 years ago

+ +
+ +
+

124M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

3:02

+
+
+ + +
+
+ +

Shared 10 years ago

+ +
+ +
+

8.8M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

1:36:11

+
+
+ + +
+
+ +

Shared 3 months ago

+ +
+ +
+

39K views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

1:43:58

+
+
+ + +
+
+ +

Shared 11 months ago

+ +
+ +
+

592K views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

1:05:10

+
+
+ +
+ +
+
+ + + + + + + + + + + +
+
+
+
+
+ +

Shared 3 years ago

+ +
+ +
+

7.6M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

11:48

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

12M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

4:33

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

30M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

38:21

+
+
+ + +
+
+ +

Shared 4 years ago

+ +
+ +
+

1.8M views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

1:54:54

+
+
+ + +
+
+ +

Shared 8 months ago

+ +
+ +
+

72K views

+
+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+

3:48

+
+
+ + +
+
+ +

Shared 13 years ago

+ +
+ +
+

18M views

+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ + + diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/macros bca37d848db740deab4c5801bd1eef18.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/macros bca37d848db740deab4c5801bd1eef18.md new file mode 100644 index 0000000..35c0e42 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/macros bca37d848db740deab4c5801bd1eef18.md @@ -0,0 +1,3 @@ +# macros + +[https://www.autohotkey.com/boards/viewtopic.php?t=34355](https://www.autohotkey.com/boards/viewtopic.php?t=34355) \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/youtube stream itags be99980f6ca34db5abde5ac77495b.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/youtube stream itags be99980f6ca34db5abde5ac77495b.md new file mode 100644 index 0000000..a66963e --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Extras 52e0285b6a994018ba3a68c7c33ca3de/youtube stream itags be99980f6ca34db5abde5ac77495b.md @@ -0,0 +1,111 @@ +# youtube stream itags + +YouTube video stream format codes itags + +[Raw](https://gist.github.com/sidneys/7095afe4da4ae58694d128b1034e01e2/raw/9794b8b7237306d8f9efd8e83ccb08fc9e188432/youtube_format_code_itag_list.md) + +**[youtube_format_code_itag_list.md](https://gist.github.com/sidneys/7095afe4da4ae58694d128b1034e01e2#file-youtube_format_code_itag_list-md)** + +# YouTube video stream format codes + +### Comprehensive list of YouTube format code itags + +| itag Code | Container | Content | Resolution | Bitrate | Range | VR / 3D | +| --- | --- | --- | --- | --- | --- | --- | +| 5 | flv | audio/video | 240p | - | - | - | +| 6 | flv | audio/video | 270p | - | - | - | +| 17 | 3gp | audio/video | 144p | - | - | - | +| 18 | mp4 | audio/video | 360p | - | - | - | +| 22 | mp4 | audio/video | 720p | - | - | - | +| 34 | flv | audio/video | 360p | - | - | - | +| 35 | flv | audio/video | 480p | - | - | - | +| 36 | 3gp | audio/video | 180p | - | - | - | +| 37 | mp4 | audio/video | 1080p | - | - | - | +| 38 | mp4 | audio/video | 3072p | - | - | - | +| 43 | webm | audio/video | 360p | - | - | - | +| 44 | webm | audio/video | 480p | - | - | - | +| 45 | webm | audio/video | 720p | - | - | - | +| 46 | webm | audio/video | 1080p | - | - | - | +| 82 | mp4 | audio/video | 360p | - | - | 3D | +| 83 | mp4 | audio/video | 480p | - | - | 3D | +| 84 | mp4 | audio/video | 720p | - | - | 3D | +| 85 | mp4 | audio/video | 1080p | - | - | 3D | +| 92 | hls | audio/video | 240p | - | - | 3D | +| 93 | hls | audio/video | 360p | - | - | 3D | +| 94 | hls | audio/video | 480p | - | - | 3D | +| 95 | hls | audio/video | 720p | - | - | 3D | +| 96 | hls | audio/video | 1080p | - | - | - | +| 100 | webm | audio/video | 360p | - | - | 3D | +| 101 | webm | audio/video | 480p | - | - | 3D | +| 102 | webm | audio/video | 720p | - | - | 3D | +| 132 | hls | audio/video | 240p | - | - | | +| 133 | mp4 | video | 240p | - | - | | +| 134 | mp4 | video | 360p | - | - | | +| 135 | mp4 | video | 480p | - | - | | +| 136 | mp4 | video | 720p | - | - | | +| 137 | mp4 | video | 1080p | - | - | | +| 138 | mp4 | video | 2160p60 | - | - | | +| 139 | m4a | audio | - | 48k | - | | +| 140 | m4a | audio | - | 128k | - | | +| 141 | m4a | audio | - | 256k | - | | +| 151 | hls | audio/video | 72p | - | - | | +| 160 | mp4 | video | 144p | - | - | | +| 167 | webm | video | 360p | - | - | | +| 168 | webm | video | 480p | - | - | | +| 169 | webm | video | 1080p | - | - | | +| 171 | webm | audio | - | 128k | - | | +| 218 | webm | video | 480p | - | - | | +| 219 | webm | video | 144p | - | - | | +| 242 | webm | video | 240p | - | - | | +| 243 | webm | video | 360p | - | - | | +| 244 | webm | video | 480p | - | - | | +| 245 | webm | video | 480p | - | - | | +| 246 | webm | video | 480p | - | - | | +| 247 | webm | video | 720p | - | - | | +| 248 | webm | video | 1080p | - | - | | +| 249 | webm | audio | - | 50k | - | | +| 250 | webm | audio | - | 70k | - | | +| 251 | webm | audio | - | 160k | - | | +| 264 | mp4 | video | 1440p | - | - | | +| 266 | mp4 | video | 2160p60 | - | - | | +| 271 | webm | video | 1440p | - | - | | +| 272 | webm | video | 4320p | - | - | | +| 278 | webm | video | 144p | - | - | | +| 298 | mp4 | video | 720p60 | - | - | | +| 299 | mp4 | video | 1080p60 | - | - | | +| 302 | webm | video | 720p60 | - | - | | +| 303 | webm | video | 1080p60 | - | - | | +| 308 | webm | video | 1440p60 | - | - | | +| 313 | webm | video | 2160p | - | - | | +| 315 | webm | video | 2160p60 | - | - | | +| 330 | webm | video | 144p60 | - | hdr | | +| 331 | webm | video | 240p60 | - | hdr | | +| 332 | webm | video | 360p60 | - | hdr | | +| 333 | webm | video | 480p60 | - | hdr | | +| 334 | webm | video | 720p60 | - | hdr | | +| 335 | webm | video | 1080p60 | - | hdr | | +| 336 | webm | video | 1440p60 | - | hdr | | +| 337 | webm | video | 2160p60 | - | hdr | | + +```jsx +//quality:itag +const iTags = { + 144: "394", //videoonly: 394,132 + 240: "395", //videoonly: 395,133 + + 360: "18", //videoonly: 396,134 both: 18 + 480: "44", //videoonly: 397, 135 both: 44 + 720: "22", //videoonly: 398, 136 both: 22 + 1080: "37", //videoOnly: 399, 137 both: 37 + 1440: "264", + 2160: "138", +}; + +// bitrate : itag +const iTagAudio = { + 128: "140", //mp4 + 64: "250", //webm + 160: "251", //webm + 48: "249", //webm +}; +``` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a.md new file mode 100644 index 0000000..b28a20a --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a.md @@ -0,0 +1,11 @@ +# GitHub + +[Managing Different Accounts](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/GitHub%20cc67e8c9e0c945a587b473d533a8d80a/Managing%20Different%20Accounts%200b4d3ba72da14c688ca2fc.md) + +[Deploy react site](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/GitHub%20cc67e8c9e0c945a587b473d533a8d80a/Deploy%20react%20site%209aac11a6fab14d8b9165b5927bff7405.md) + +[Git commands](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/GitHub%20cc67e8c9e0c945a587b473d533a8d80a/Git%20commands%206fce236e7a9646bdbbf63290300cf5b4.md) + +[Setting multiple accounts](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/GitHub%20cc67e8c9e0c945a587b473d533a8d80a/Setting%20multiple%20accounts%20734586287c324b9e98996805.md) + +[Project commit ids](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/GitHub%20cc67e8c9e0c945a587b473d533a8d80a/Project%20commit%20ids%206193aa70a9c64e9bb2e25c4e3003847.md) \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Deploy react site 9aac11a6fab14d8b9165b5927bff7405.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Deploy react site 9aac11a6fab14d8b9165b5927bff7405.md new file mode 100644 index 0000000..5ec3dfe --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Deploy react site 9aac11a6fab14d8b9165b5927bff7405.md @@ -0,0 +1,91 @@ +# Deploy react site + +- for vite use this + https://dev.to/rashidshamloo/deploying-vite-react-app-to-github-pages-35hf + +From site ‘[https://create-react-app.dev/docs/deployment/](https://create-react-app.dev/docs/deployment/)’ + +## [GitHub Pages](https://pages.github.com/)[](https://create-react-app.dev/docs/deployment/#github-pages) + +> Note: this feature is available with react-scripts@0.2.0 and higher. +> + +### Step 1: Add `homepage` to `package.json`[](https://create-react-app.dev/docs/deployment/#step-1-add-homepage-to-packagejson) + +**The step below is important!** + +**If you skip it, your app will not deploy correctly.** + +Open your `package.json` and add a `homepage` field for your project: + + `"homepage": "https://myusername.github.io/my-app",` + +or for a GitHub user page: + + `"homepage": "https://myusername.github.io",` + +or for a custom domain page: + + `"homepage": "https://mywebsite.com",` + +Create React App uses the `homepage` field to determine the root URL in the built HTML file. + +### Step 2: Install `gh-pages` and add `deploy` to `scripts` in `package.json`[](https://create-react-app.dev/docs/deployment/#step-2-install-gh-pages-and-add-deploy-to-scripts-in-packagejson) + +Now, whenever you run `npm run build`, you will see a cheat sheet with instructions on how to deploy to GitHub Pages. + +To publish it at [https://myusername.github.io/my-app](https://myusername.github.io/my-app), run: + +`npm install --save gh-pages`Copy + +Alternatively you may use `yarn`: + +`yarn add gh-pages`Copy + +Add the following scripts in your `package.json`: + +```json +"scripts": { +"predeploy": "npm run build", +"deploy": "gh-pages -d build", +"start": "react-scripts start", +"build": "react-scripts build", +"test": "react-scripts test", +"eject": "react-scripts eject" +}, +``` + +The `predeploy` script will run automatically before `deploy` is run. + +If you are deploying to a GitHub user page instead of a project page you'll need to make one additional modification: + +1. Tweak your `package.json` scripts to push deployments to **master**: + +```json + "scripts": { + "predeploy": "npm run build", +- "deploy": "gh-pages -d build", ++ "deploy": "gh-pages -b master -d build", +``` + + `"scripts": { "predeploy": "npm run build",- "deploy": "gh-pages -d build",+ "deploy": "gh-pages -b master -d build",`Copy + +### Step 3: Deploy the site by running `npm run deploy`[](https://create-react-app.dev/docs/deployment/#step-3-deploy-the-site-by-running-npm-run-deploy) + +Then run: + +`npm run deploy` + +### Step 4: For a project page, ensure your project’s settings use `gh-pages`[](https://create-react-app.dev/docs/deployment/#step-4-for-a-project-page-ensure-your-projects-settings-use-gh-pages) + +Finally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch: + +![https://i.imgur.com/HUjEr9l.png](https://i.imgur.com/HUjEr9l.png) + +### Step 5: Optionally, configure the domain[](https://create-react-app.dev/docs/deployment/#step-5-optionally-configure-the-domain) + +You can configure a custom domain with GitHub Pages by adding a `CNAME` file to the `public/` folder. + +Your CNAME file should look like this: + +`mywebsite.com` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Git commands 6fce236e7a9646bdbbf63290300cf5b4.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Git commands 6fce236e7a9646bdbbf63290300cf5b4.md new file mode 100644 index 0000000..71730e0 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Git commands 6fce236e7a9646bdbbf63290300cf5b4.md @@ -0,0 +1,132 @@ +# Git commands + +- Resetting local to specific commit + + [https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit](https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit) + + `git reset --hard && git clean -f` + + or a safer + + `git clean -i` + + commit id: + + ![Untitled](../../../_resources/Untitled-8.png) + + Use `git log` for commit id. + + ### Reverting Working Copy to Most Recent Commit + + To revert to the previous commit, ignoring any changes: + + ```bash + git reset --hard HEAD + ``` + + where HEAD is the last commit in your current branch + + ### Reverting The Working Copy to an Older Commit + + To revert to a commit that's older than the most recent commit: + + ```bash + # Resets index to former commit; replace '56e05fced' with your commit code + git reset 56e05fced + + # Moves pointer back to previous HEAD + git reset --soft HEAD@{1} + + git commit -m "Revert to 56e05fced" + + # Updates working copy to reflect the new commit + git reset --hard + + # Push your changes to respective branch + git push -f + ``` + + save modifications before resetting: + + ```bash + # Alternatively, if there's work to keep: + git stash + git reset --hard 0d1d7fc32 + git stash pop + # This saves the modifications, then reapplies that patch after resetting. + # You could get merge conflicts, if you've modified things which were + # changed since the commit you reset to. + ``` + + To revert changes after git push use revert instead of reset —hard + + `git revert ` + + or simply use below after using reset —hard + + `git push -f origin main` + + do not use —force, this will make all your coworkers hate you, use —force-with-lease, this will only allow you to push the code if there are no conflicting changes with the current parent branch + +- Branches + + [https://www.geeksforgeeks.org/how-to-set-upstream-branch-on-git/](https://www.geeksforgeeks.org/how-to-set-upstream-branch-on-git/) + + ![Untitled](../../../_resources/Untitled%201-5.png) + + ![Untitled](../../../_resources/Untitled%202-4.png) + for adding remote url + `git remote add ` + then + `git push --set-upstream master` + PS C:\Users\harsh\Videos\imp\react\github\test1> `git branch main -u origin/main` + Branch 'main' set up to track remote branch 'main' from 'origin'.* + + *PS C:\Users\harsh\Videos\imp\react\github\test1> `git branch test -u origin/test` + Branch 'test' set up to track remote branch 'test' from 'origin'. + + `git push --set-upstream origin ` + to show remote git details like url and all that + `git remote show origin` or `git remote -v` (to see only url) + To edit current url + `git remote set-url origin git@bitbucket.org:tutorials/tutorials.git` + + ### **Merging other branch to main:** + + Make sure first you update your **development** branch with master to resolve conflicts issue(if there are any): + + ```bash + git checkout main + git pull origin main + git checkout development + git merge main + + ``` + + Now see if master branch is merged without any conflict, if there's any conflict then you'll have to resolve them. Once you're done with that, you can: + + ```bash + git checkout main + git merge development + git push origin main + ``` + + To copy content from A to B + + `git checkout B` + + `git merge A` + + If A is test and B is main then + + `git checkout main` + + `git merge test` + + To create a branch of specific commit: + + `git checkout -b old_state ` + +- Configuration + + `git config —-global [user.name](http://user.name) 'moss'` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Managing Different Accounts 0b4d3ba72da14c688ca2fc.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Managing Different Accounts 0b4d3ba72da14c688ca2fc.md new file mode 100644 index 0000000..f213392 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Managing Different Accounts 0b4d3ba72da14c688ca2fc.md @@ -0,0 +1,23 @@ +# Managing Different Accounts + + + +Using more than 1 git account on same machine + +### While cloning +- git clone git@github.com-work + Here `git@github.com-work` is ssh id + + +So if username is a1 and a2 then + +for a1: +`git clone git@github.com:a1/code-repo.git` + +for a2: +`git clone git@github.com:a2/code-repo.git` +  +- To add new origin + `git remote add origin git@github.com-work:a2/code-repo.git` + + \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Project commit ids 6193aa70a9c64e9bb2e25c4e3003847.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Project commit ids 6193aa70a9c64e9bb2e25c4e3003847.md new file mode 100644 index 0000000..c63773d --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Project commit ids 6193aa70a9c64e9bb2e25c4e3003847.md @@ -0,0 +1,13 @@ +# Project commit ids + +fixed scheduling of playlist : `32be0512c184d9d530efce99d1bc29aa4d38ab08` + +latest commit for bull: `7fafc78a68c80629eed471b7590f3a540565478b` + +removed job and using promises: `2c051842e47cfc5424a9e39b61a27671feb5087f` + +latest after download/upload gofile: `b880014f924cd3147d3a0449eba2f1a7e1f8dc8d` + +front end: + +added scheduling: `c310df967e76bb9ca931f59a31fa714102922571` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Setting multiple accounts 734586287c324b9e98996805.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Setting multiple accounts 734586287c324b9e98996805.md new file mode 100644 index 0000000..c163b66 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/GitHub cc67e8c9e0c945a587b473d533a8d80a/Setting multiple accounts 734586287c324b9e98996805.md @@ -0,0 +1,139 @@ +# Setting multiple accounts + +Source: [https://betterprogramming.pub/how-to-use-multiple-github-accounts-with-one-computer-c9ba3f851b75](https://betterprogramming.pub/how-to-use-multiple-github-accounts-with-one-computer-c9ba3f851b75) + +For windows I use + +``` +ssh-keygen -t rsa -C “your-email-addressâ€� +``` + +- **t** stands for ‘**type**’ and **rsa** is type of encryption +- **C** is for comment + +3. The following will then show: + +``` +Generating public/private rsa key pair. +Enter file in which to save the key (/c/Users/your_username/.ssh/id_rsa): +``` + +Copy and paste the path followed by an **identifiable name** for the file: + +``` +/c/Users/your_username/.ssh/id_rsa_IDENTIFIABLE_NAME_HERE +``` + +I named my one test for the sake of this tutorial: + +``` +/c/Users/your_username/.ssh/id_rsa_test +``` + +**Make sure you don’t override id_rsa as this is your existing key for your original account.** + +It will then ask you for the following: + +``` +Enter passphrase (empty for no passphrase): +Enter same passphrase again: +``` + +Press ‘Enter’ twice to leave it blank. + +You can now type in the following command to see all the SSH keys you have on your local machine: + +``` +ls -al ~/.ssh +``` + +- **ls** lists all the files in the current directory +- **a** is for listing all files including hidden ones +- **l** is for listing in a long format + +You should then get something similar to this: + +``` +total 46 +drwxr-xr-x 1 your_username 1049089 0 Jan 26 10:40 . +drwxr-xr-x 1 your_username 1049089 0 Jan 23 12:12 .. +-rw-r--r-- 1 your_username 1049089 3326 Nov 30 11:21 id_rsa +-rw-r--r-- 1 your_username 1049089 748 Nov 30 11:21 id_rsa.pub +-rw-r--r-- 1 your_username 1049089 1675 Jan 26 10:40 id_rsa_test +-rw-r--r-- 1 your_username 1049089 399 Jan 26 10:40 id_rsa_test.pub +-rw-r--r-- 1 your_username 1049089 803 Nov 30 12:08 known_hosts +``` + +You should be able to see your new SSH key file. As you can see in my one I have both **id_rsa_test** and **id_rsa_test.pub**. + +**id_rsa_test** is your private key stored on your machine, whilst **id_rsa_test.pub** is the public key which you will provide GitHub with. + +Next you need to copy the **SSH key** which is stored in **id_rsa_test.pub** file. You can open this in text editor of your choice. I am currently using atom so I opened the file using the following command: + +``` +atom ~/.ssh/id_rsa_test.pub +``` + +You will then get something similar to this: + +``` +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEmSbc7ms4SNIf7G0e9EqdrQRTB17VFTqRtCbQ55sSc11xZP5B07UXf9+................a955cf1GUzsNIr60E7VuVxirrr+K2WcleqifnDEg1H/VbyJtEekh4Aav9csBwemTz3test@test.com +``` + +The key is actually longer but I shortened it for the sake of this tutorial. + +Copy this and navigate to your **GitHub account** → **Settings** → **SSH and GPG keys** + +![https://miro.medium.com/max/1050/1*hGgGWVSSLZ14dfRlvHx59Q.png](https://miro.medium.com/max/1050/1*hGgGWVSSLZ14dfRlvHx59Q.png) + +Click on **New SSH key** + +![https://miro.medium.com/max/1050/1*Dv0QXfBnu5mcb2eKLcQxUg.png](https://miro.medium.com/max/1050/1*Dv0QXfBnu5mcb2eKLcQxUg.png) + +Give your new key a title and then paste the **new generated SSH key** you copied before. ***It is a good idea to name your keys after the machine they’re from. As you can see I have three, Macbook, Windows and Cloud9 IDE***. + +If you’re on a Mac you should be able to add this key on your terminal as well using the command below: + +``` +ssh-add ~/.ssh/id_rsa_test +``` + +For enabling ssh: + +39 + +In Windows PowerShell (run as admin): + +1. Check the current status of **ssh-agent**: + + `Get-Service | ?{$_.Name -like '*ssh-agent*'} | select -Property Name, StartType, Status` + +2. Enable the Service if it is disabled: + + `Set-Service -Name ssh-agent -StartupType Manual` + +3. Start the Service: + + `Start-Service ssh-agent` + + then + + `cd ~` + +4. Add your key as before: + + `ssh-add ` + + +Creating config file : format + +``` +Host github.com + HostName github.com + User git + IdentityFile ~/.ssh/id_rsa +Host github.com-work + HostName github.com + User git + IdentityFile ~/.ssh/id_rsa_work +``` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e.md new file mode 100644 index 0000000..90b7baa --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e.md @@ -0,0 +1,287 @@ +# Heroku + +[Installation and Pushing Code](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Heroku%20531d47e94b8843d7a0dc8ffce482bf9e/Installation%20and%20Pushing%20Code%20d782fb23e4a642358c74.md) + +[Connecting with PostgreSQL Database](../../Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web%20development%2083dd4e6675f04ba782a6865a434a0598/Heroku%20531d47e94b8843d7a0dc8ffce482bf9e/Connecting%20with%20PostgreSQL%20Database%2027806e96bc2941.md) + +Heroku alternatives: + +[https://www.youtube.com/watch?v=UZsMx_7LEj8](https://www.youtube.com/watch?v=UZsMx_7LEj8) + +[https://www.youtube.com/watch?v=MusIvEKjqsc](https://www.youtube.com/watch?v=MusIvEKjqsc) + +[https://bloggersdesire.com/hosting-trial-no-credit-card/](https://bloggersdesire.com/hosting-trial-no-credit-card/) : site + +[https://www.guru99.com/free-web-hosting-sites.html](https://www.guru99.com/free-web-hosting-sites.html) + +uptimerobot nodejs for bots + +[https://www.staas.io/dashboard/stack?id=nodejsweek3305&cmd=restart&error=&success=Stack RESTART command is processed&data_id=Xf6PbWjQqrEuN3-W5K_tV](https://www.staas.io/dashboard/stack?id=nodejsweek3305&cmd=restart&error=&success=Stack%20RESTART%20command%20is%20processed&data_id=Xf6PbWjQqrEuN3-W5K_tV) + +qovery +glitch : for hosting + +surge : for frontend +[https://host.ehxz.tk/](https://host.ehxz.tk/) + +replit + +deta cloud: [https://www.deta.sh/](https://www.deta.sh/) nodejs + +adaptable io + +back4app + +coolify : self hosted platform means we need our own server + +for deta cloud server file should be index.js not app.js or server.js and at last of index.js add this: + +`module.exports=app` where `app=express()` + +elephantSQL : for postgreSQL + +[https://supabase.com/pricing](https://supabase.com/pricing) : for postgres + +[https://www.youtube.com/watch?v=prjMJtXCR-g](https://www.youtube.com/watch?v=prjMJtXCR-g) : with database too + +[https://ekomenyong.com/posts/how-to-setup-free-postgresql-database-on-railway-app](https://ekomenyong.com/posts/how-to-setup-free-postgresql-database-on-railway-app) + +[https://blog.railway.app/p/postgre-backup](https://blog.railway.app/p/postgre-backup) + +- Puppeteer on render cloud + + [https://render.com/docs/deploy-puppeteer-node](https://render.com/docs/deploy-puppeteer-node) + + Browser as service : [https://dashboard.phantomjscloud.com/](https://dashboard.phantomjscloud.com/) + + [https://phantomjscloud.com/docs/http-api/#script-examples](https://phantomjscloud.com/docs/http-api/#script-examples) + + video related to it : [https://www.youtube.com/watch?v=lcSMCta1Bcg](https://www.youtube.com/watch?v=lcSMCta1Bcg) + + uploading on vercel : [https://www.youtube.com/watch?v=X6VIWHl3JmM](https://www.youtube.com/watch?v=X6VIWHl3JmM) + + - code for uploading in vercel + + ```jsx + const btoa = require("btoa"); + const path = require("path"); + let chromium; + // Check if we are running locally or on Vercel + if (!process.env.AWS_LAMBDA_FUNCTION_VERSION) { + const puppeteer = require("puppeteer"); + chromium = { + puppeteer, + }; + } else { + chromium = require("chrome-aws-lambda"); + } + const renderHTML = require("./render-html"); + + /** + * Normalizes the theme name by adding a prefix `jsonresume-theme` if not present + * @param {String} value Name of the theme + * @param {String} defaultValue Default Theme + */ + const normalizeTheme = (value, defaultValue = "even") => { + const theme = value || defaultValue; + + // If theme has a relative path provided, immediately return + if (theme[0] === ".") { + return theme; + } + + return theme.match("jsonresume-theme-.*") + ? theme + : `jsonresume-theme-${theme}`; + }; + + /** + * Returns the theme Package + * @param {String} theme Normalized theme name + */ + const getThemePackage = (theme) => { + if (theme[0] === ".") { + theme = path.join(process.cwd(), theme, "index.js"); + } + + try { + const themePackage = require(theme); + return themePackage; + } catch (err) { + // Theme not installed + throw new Error( + "You have to install this theme relative to the folder to use it e.g. `npm install " + + theme + + "`" + ); + } + }; + + /** + * Parses the `resumeJson` to render a pretty HTML + * @param {Object} resumeJson Resume data + * @param {String} themeName Name of the theme + */ + const parse = async (resumeJson, themeName) => { + const html = await renderHTML({ + resume: resumeJson, + themePath: themeName, + }); + return html; + }; + + // See https://vercel.com/knowledge/how-to-enable-cors + const allowCors = (fn) => async (req, res) => { + res.setHeader("Access-Control-Allow-Credentials", true); + res.setHeader("Access-Control-Allow-Origin", "*"); + res.setHeader( + "Access-Control-Allow-Methods", + "GET,OPTIONS,PATCH,DELETE,POST,PUT" + ); + res.setHeader( + "Access-Control-Allow-Headers", + "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" + ); + + // Handle CORS pre-flight + if (req.method === "OPTIONS") { + res.status(200).end(); + return; + } + + return await fn(req, res); + }; + + const handler = async (req, res) => { + try { + const { resumeData } = req.body; + const normalizedTheme = normalizeTheme(resumeData.meta.theme, "even"); + const themePackage = getThemePackage(normalizedTheme); + const html = await parse(resumeData, normalizedTheme); + const browser = await chromium.puppeteer.launch(); + const page = await browser.newPage(); + await page.emulateMediaType( + (themePackage.pdfRenderOptions && + themePackage.pdfRenderOptions.mediaType) || + "screen" + ); + await page.goto( + `data:text/html;base64,${btoa(unescape(encodeURIComponent(html)))}`, + { waitUntil: "networkidle0" } + ); + if (themePackage.pdfViewport) { + await page.setViewport(themePackage.pdfViewport); + } + const pdf = await page.pdf({ + format: "Letter", + printBackground: true, + margin: { + top: "0.5in", + bottom: "0.5in", + left: "0.5in", + right: "0.5in", + }, + ...themePackage.pdfRenderOptions, + }); + + await browser.close(); + + res.setHeader("Content-Type", "application/pdf"); + res.setHeader("Content-Length", pdf.length); + res.send(pdf); + } catch (err) { + res.status(500); + res.json({ + error: err, + }); + } + }; + + module.exports = allowCors(handler); + ``` + + +- Glitch(to test the app without hosting) + + [https://www.youtube.com/watch?v=3hVf4Giy5nc](https://www.youtube.com/watch?v=3hVf4Giy5nc) + + ![Screenshot_2022-11-08-12-57-32-398_com.android.chrome.jpg](../../_resources/Screenshot_2022-11-08-12-57-32-398_com.android.chr.jpg) + +- Puppeteer on glitch + + ![Untitled](../../_resources/Untitled-2.png) + + this should be the version ie 1.3.0 not the latest one + + ```jsx + const browser = await puppeteer.launch({ + args: ['--no-sandbox'] + }); + ``` + +- FireBase + + [https://www.youtube.com/watch?v=WaYPrpOvsZE](https://www.youtube.com/watch?v=WaYPrpOvsZE) + + - Guide + + To host a Node.js application in Firebase, you can follow these steps: + + 1. Set up Firebase: Visit the Firebase website (**[https://firebase.google.com/](https://firebase.google.com/)**) and create an account if you don't have one already. Once logged in, create a new project. + 2. Install Firebase CLI: Install the Firebase Command Line Interface (CLI) globally on your machine by running the following command in your terminal: + + ``` + Copy code + npm install -g firebase-tools + + ``` + + 3. Initialize Firebase: In your terminal, navigate to your Node.js project's root directory. Run the following command to initialize Firebase within your project: + + ``` + csharpCopy code + firebase init + + ``` + + This will prompt you to select the Firebase features you want to use. Choose "Hosting" and select your Firebase project from the list. + + 4. Configure Firebase Hosting: During the initialization process, you'll be asked to configure Firebase Hosting. Set the public directory to the folder containing your Node.js application's static files. If your Node.js app serves static files from a **`public`** folder, you can specify it as the public directory. Firebase Hosting is designed to host static files, so for a Node.js application, you'll need to configure Firebase to serve the static files while handling dynamic requests. + 5. Modify Firebase Configuration (Optional): If your Node.js application requires additional server-side configuration, you can modify the generated **`firebase.json`** file to include a **`rewrites`** property. This allows you to define rules for routing requests to your Node.js application. For example: + + ``` + jsonCopy code + "rewrites": [ + { + "source": "**", + "function": "yourNodeJsFunction" + } + ] + + ``` + + This configuration redirects all requests to your Node.js function. Replace **`"yourNodeJsFunction"`** with the appropriate function name. + + 6. Deploy to Firebase Hosting: Once your configuration is complete, deploy your Node.js application to Firebase Hosting by running the following command: + + ``` + Copy code + firebase deploy + + ``` + + This will upload your static files and deploy your Node.js application to Firebase Hosting. + + 7. Access Your Deployed Application: After the deployment is successful, Firebase will provide you with a URL where your Node.js application is hosted. You can access it from any web browser. + + Keep in mind that Firebase Hosting is primarily designed for hosting static files, so it might not be suitable for all types of Node.js applications. If your application has specific server-side requirements or requires more complex routing and API functionality, you might need to consider other hosting options like virtual private servers (VPS), cloud platforms, or dedicated Node.js hosting providers. + + Also, ensure that your Node.js application is properly configured to handle production deployments and security considerations such as environment variables and authentication mechanisms. + + for testing locally use `firebase serve` + + +- Video hosting platform + + 1: vimeo + 2: vidyard \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Connecting with PostgreSQL Database 27806e96bc2941.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Connecting with PostgreSQL Database 27806e96bc2941.md new file mode 100644 index 0000000..a2bd735 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Connecting with PostgreSQL Database 27806e96bc2941.md @@ -0,0 +1,80 @@ +# Connecting with PostgreSQL Database + +- Local important commands for exporting and importing + + ### Exporting postgresql Database + + We need to create a dump file. Here *smart-brain* is name of database + + `pg_dump -U postgres smart-brain > dump.sql` + + ### Importing postgresql Database + + `psql -U postgres smart-brain < dump.sql` + + For using insert into instead of copy: [https://stackoverflow.com/questions/2827072/sql-convert-backup-file-from-copy-format-to-insert-format](https://stackoverflow.com/questions/2827072/sql-convert-backup-file-from-copy-format-to-insert-format) + + `pg_dump --column-inserts -U > dumpWithInserts.sql` + + for railway cloud: + + [https://blog.railway.app/p/postgre-backup](https://blog.railway.app/p/postgre-backup) + + The above may not work well in windows so we can use the pgadmin which is workbench. To create dump file use backup functionality with binary encoding. This dump file can be easily imported using restore functionality. + + Some extra functionality like: + + To get list of tables: `\d` + + to get schema of table ‘users’: `\d users;` + + +### Importing dump file to heroku created by pgadmin + +dump file to be imported to heroku must be publically accessible http url. Dropbox is recommended and remove letter ‘s’ from https(https→ http). + +`heroku pg: backups: restore ‘http://…..’` + +- Configuration for postgreSQL in nodejs for production mode: + + ```jsx + const knex = require("knex")({ + client: "pg", + connection: { + // host: "127.0.0.1", + connectionString: process.env.DATABASE_URL, + ssl: { rejectUnauthorized: false }, + + + + }, + }); + ``` + + This database_url is to be uploaded in heroku config file section under settings when navigated to the particular app.Refer to the image: + + + +![heroku env.png](../../../_resources/heroku%20env.png) + + + + This database_url can be accessed by using the heroku command: + + heroku pg:info + + + + + +![heroku database_url.png](../../../_resources/heroku%20database_url.png) + + + + This add-on property contains databse url. + + +### Accessing database through command prompt: + +`heroku pg:psql -a face-extractor-app` + diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Installation and Pushing Code d782fb23e4a642358c74.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Installation and Pushing Code d782fb23e4a642358c74.md new file mode 100644 index 0000000..521e68f --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Heroku 531d47e94b8843d7a0dc8ffce482bf9e/Installation and Pushing Code d782fb23e4a642358c74.md @@ -0,0 +1,59 @@ +# Installation and Pushing Code + +## I**nstallation** + +- At root directory of nodejs app + + ```bash + git init + git add . + git commit -m 'initialize' + ``` + + +• (Make sure to install heroku cli) + +`• heroku create or heroku create appname` + +- If there is already an existing app then we need to change the prev origin to current one by: + + `heroku git:remote -a appname` + +- For changing app name, remote name has to be changed too. + +```bash +git remote rename heroku newname +``` + + + +or + +```bash +git remote heroku newname +heroku git:remote -a newname +``` + +- For changing app name(this has to be done before) + +`heroku apps: rename newname` + +or for outside git repository + +`heroku apps: rename newname —app oldname` + +## **Pushing Code** + +`git push heroku main` + +For non-main branch: + +`git push heroku testbranch:main` + +**In nodejs app:** + +```jsx +app.listen(process.env.PORT || 3000,()=>{ + console.log('listening'); +}) +``` \ No newline at end of file diff --git a/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Javascript 6f088d74b3964122989469823aade1d6.md b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Javascript 6f088d74b3964122989469823aade1d6.md new file mode 100644 index 0000000..4d16758 --- /dev/null +++ b/Export-9fad9947-5bd5-4195-952b-6512c5a4beb1/Web development 83dd4e6675f04ba782a6865a434a0598/Javascript 6f088d74b3964122989469823aade1d6.md @@ -0,0 +1,167 @@ +# Javascript + +- **Split regex** + + 1: when using split function using regex, if we want to include delimiters in array instead of just skipping them then we need to include brackets for delimiters. + for eg: + + ```jsx + calcInput='2*3' + let arr = calcInput.split(/([*\/+-])/); + // arr-> ['2', '*', '3'] + without brackets split(/[*\/+-])/) + // arr=['2', '3'] + ``` + + +2: **typeof**: to get type of literal. + +for eg: + +`typeof 'str’` -> ‘string’ + +- regex reference + + [JavaScript RegExp Reference](https://www.w3schools.com/jsref/jsref_obj_regexp.asp) + + ```python + import re + In [14]: par = "This is a paragraph? So it is! Ok, there are 3 sentences." + In [15]: re.split(r'[.!?]+', par) + Out[15]: ['This is a paragraph', ' So it is', ' Ok, there are 3 sentences', ''] + ``` + + for splitting sentences in python + +- Parsing using regex + + Suppose if we wnna extract id from url or text then + + `id = /var k__id = "(.*?)"/.exec(result)[1]` + + also to extract id from embed youtube video. + + for eg: + + ```jsx + let url="[https://www.youtube.com/embed/Ko58_KjgM0E](https://www.youtube.com/embed/Ko58_KjgM0E)" + let reg=/embed\/(.*)/ + const id=reg.exec('https://www.youtube.com/embed/Ko58_KjgM0E')[1] + + // Output: + // "Ko58_KjgM0E" + ``` + +- Using fetch to send form data + + in body use format `=` and use `content-type: "application/x-www-form-urlencoded"`. + + ```jsx + const getToken = async () => { + const url = "https://accounts.spotify.com/api/token"; + const authOptions = { + method: "post", + // url: "https://accounts.spotify.com/api/token", + headers: { + Authorization: + "Basic " + + new Buffer(clientID + ":" + clientSecret).toString("base64"), + "Content-Type": "application/x-www-form-urlencoded", + }, + // form data with key 'grant_type' and value 'client_credentials' + // written as + body: "grant_type=client_credentials", + + // json: true, + }; + + const result = await fetch(url, authOptions); + const data = await result.json(); + return data.access_token; + }; + ``` + +- HTTP basics + + [https://eloquentjavascript.net/18_http.html](https://eloquentjavascript.net/18_http.html#HTTP%201.1) + +- onchange on select element + + Another approach which can be handy in some situations, is passing the value of the selected `