How to Push to a GitHub Repository in IntelliJ

Image
1. Initialize and Connect the Git Repository # Run in the terminal from the project root git init git remote add origin https://github.com/[user]/[repository].git 2. Configure Git in IntelliJ Select VCS → Enable Version Control Integration . Choose Git and click OK . 3. Connect Your GitHub Account Go to File → Settings (on Windows) or IntelliJ IDEA → Preferences (on macOS). Navigate to Version Control → GitHub . Click Add Account ( + ). Select Log In with Token... and enter your GitHub Personal Access Token. 4. Add and Commit Files Go to VCS → Git → Add (or use the shortcut Ctrl+Alt+A ). Select the files you want to commit. Go to VCS → Commit (or use the shortcut Ctrl+K ). Write a commit message and click Commit . 5. Push Go to VCS → Git → Push (or use the shortcut Ctrl+Shift+K ). Click the Push button. Simpler Method (Using IntelliJ's Built-in Feature) Go to VCS → Share Project on GitHub . Set the repository name to vita-user-...

How to Add Syntax Highlighting to Blogger Using Prism.js

There are many great platforms these days for starting a technical blog, but most are either paid or require a bit of setup.

That’s why I chose Blogger — it's free, simple, and easy to get started.

However, as a technical blogger, I often need to share things like Linux commands, source code snippets, or terminal outputs — and unfortunately, Blogger doesn't support code blocks natively.

To resolve this, I added a syntax highlighting library called Prism.js to my Blogger theme so that code in my posts looks clean and readable.

How to Set Up Prism.js for Syntax Highlighting in Blogger

Step 1: Open the Blogger Theme Editor

  1. Log in to your Blogger account
  2. On the left menu, click “Theme”
  3. Click the "▼ arrow" next to the current theme and select "Edit HTML"


Step 2: Add Prism.js to the <head> section

  1. In the HTML editor, find the <head> tag near the top of the code.
  2. Add the following lines inside the <head> tag:
  3. Click the Save button (top right corner)
<head>
  <meta content='width=device-width, initial-scale=1' name='viewport'/>
  <title><data:view.title.escaped/></title>

  <!-- Prism CSS -->
  <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" />

  <!-- Prism JS (Core) -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>

  <!-- Language Components -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-java.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-http.min.js"></script>
⚠️ Important: Do not self-close <script> tags like
<script ... />.
Always use the full format: <script>...</script>

How to Use Code Blocks in Your Posts

When writing a post, switch to “HTML view” and insert code using the <pre><code> format like this:

<pre><code class="language-bash">
sudo netplan apply
</code></pre>
<pre><code class="language-java">
System.out.println("Hello, world!");
</code></pre>
<pre><code class="language-python">
def hello():
    print("Hello, world!")
</code></pre>
<pre><code class="language-http">
GET /api/users HTTP/1.1
Host: example.com
</code></pre>

Switch to a Dark Theme for Prism.js

If you prefer a dark look for your code blocks, simply swap the CSS link with a different Prism theme:

<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css" rel="stylesheet" />

Other popular themes include:

  • prism-tomorrow
  • prism-coy
  • prism-dark

See all themes: https://prismjs.com

Comments

Popular posts from this blog

Resolving Key Exchange Failure When Connecting with SecureCRT to OpenSSH

SecureCRT] How to Back Up and Restore SecureCRT Settings on Windows

How to Set Up Vaultwarden (Bitwarden) on Synology NAS (Best Free Alternative to LastPass)