<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: aiocat</title>
    <description>The latest articles on Forem by aiocat (@aiocat).</description>
    <link>https://forem.com/aiocat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F697804%2Fd9466868-75c0-4387-a0b7-d5c7176a9bdf.png</url>
      <title>Forem: aiocat</title>
      <link>https://forem.com/aiocat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aiocat"/>
    <language>en</language>
    <item>
      <title>Request - Minimal HTTP Client</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Tue, 12 Apr 2022 13:04:30 +0000</pubDate>
      <link>https://forem.com/aiocat/request-minimal-http-client-4m95</link>
      <guid>https://forem.com/aiocat/request-minimal-http-client-4m95</guid>
      <description>&lt;h2&gt;
  
  
  Request
&lt;/h2&gt;

&lt;p&gt;Request is a simple tool that allows user to test their API with web interface.&lt;/p&gt;

&lt;p&gt;Request is written with tauri and vite vanilla typescript and its fully open-source!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository: &lt;a href="https://github.com/aiocat/request"&gt;https://github.com/aiocat/request&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can contribute to the project if you want to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Save, load, delete requests&lt;/li&gt;
&lt;li&gt;View headers&lt;/li&gt;
&lt;li&gt;Generate request code&lt;/li&gt;
&lt;li&gt;Send request with headers&lt;/li&gt;
&lt;li&gt;Filter requests&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Lots of postman (like) program already exists. But they are really confusing and they have lots of feature we don't need.&lt;/p&gt;

&lt;p&gt;Since CLI is not for everyone, I made request, minimal http client for your toy projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Download
&lt;/h3&gt;

&lt;p&gt;You can download request from &lt;a href="https://github.com/aiocat/request#download"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Download the installer from github releases and enjoy! The UI is made childish for everyone to understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wfk7CP0B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wfk7CP0B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss1.png" alt="s1" width="880" height="643"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---pSMmcW7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---pSMmcW7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss2.png" alt="s2" width="880" height="643"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WwdrTMRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WwdrTMRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss3.png" alt="s3" width="880" height="643"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a0P-GOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a0P-GOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/aiocat/request/main/assets/ss4.png" alt="s4" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
      <category>webdev</category>
      <category>vite</category>
    </item>
    <item>
      <title>Connecting devices together!</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Fri, 11 Mar 2022 18:36:30 +0000</pubDate>
      <link>https://forem.com/aiocat/connecting-devices-together-is-easy-59b4</link>
      <guid>https://forem.com/aiocat/connecting-devices-together-is-easy-59b4</guid>
      <description>&lt;h2&gt;
  
  
  Sock Idea
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Sock-Net"&gt;Organization&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sock is a idea, not a code. "Sock" allows you to connect to channels and communicate with other instances. Everyone can make his own "Sock" and "Sock Client". Or you can use &lt;a href="https://github.com/Sock-Net/sock"&gt;Lightweight Sock Server&lt;/a&gt; to host a Sock.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Websockets?
&lt;/h2&gt;

&lt;p&gt;Simple, websocket is easy to use in browser. This allows you to host a "Sock" server and manage sock to communicate between back-end and front-end easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not?
&lt;/h2&gt;

&lt;p&gt;Not recommended for embedded devices. But still, &lt;a href="https://github.com/Sock-Net/sock"&gt;Lightweight Sock Server&lt;/a&gt; only uses 2MB ram.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making a Sock Server
&lt;/h2&gt;

&lt;p&gt;To make a sock server, you must have these routes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/channel/:channel&lt;/code&gt; (WebSocket): This route is where we connect our clients.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/api/channel/:channel/:id&lt;/code&gt; (HTTP): This route allows us to get a instance from channel&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/api/channel/:channel&lt;/code&gt; (HTTP): This route allows us to get all instances from channel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And you must write-read a object that has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;type&lt;/code&gt; (int): Type for the instance. Every client has their own types.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data&lt;/code&gt; (string): This key can hold any data.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;from&lt;/code&gt; (string): For see who sent the message.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If type is less than zero (0), Message is for pinging server to keep connection alive.&lt;/p&gt;

&lt;p&gt;If type is equals to zero (0), Message is for getting current instance id.&lt;/p&gt;

&lt;p&gt;Please check &lt;a href="https://github.com/Sock-Net/sock"&gt;Lightweight Sock Server&lt;/a&gt; to understand how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making a Sock Client
&lt;/h2&gt;

&lt;p&gt;And you can make a sock client that allows anything... For example, you can make a sock client that allows to run a python code in channel and send output to other instances.&lt;/p&gt;

&lt;p&gt;We made a client that uses "Sock" to send files and data between instances. Check it &lt;a href="https://github.com/Sock-Net/sockc"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please check &lt;a href="https://github.com/Sock-Net/sockc"&gt;Sockc&lt;/a&gt; to understand how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finishing
&lt;/h2&gt;

&lt;p&gt;You can star project if you liked it!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>computerscience</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>I made a programming language without any knowledge.</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Wed, 16 Feb 2022 19:51:07 +0000</pubDate>
      <link>https://forem.com/aiocat/i-made-a-programming-language-without-any-knowledge-56c9</link>
      <guid>https://forem.com/aiocat/i-made-a-programming-language-without-any-knowledge-56c9</guid>
      <description>&lt;p&gt;Hello folks! I decided to make a minimal programming language... without any knowledge...&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting
&lt;/h2&gt;

&lt;p&gt;For this challenge, I chosed C++ because its fast. &lt;em&gt;I would chose rust but i will rewrite with rust later.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And i started to searching about making a programming language, and i got some basics about lexers, compilers etc... and I started with &lt;code&gt;reverse polish notation&lt;/code&gt; and &lt;code&gt;stack&lt;/code&gt; based language. Because they are easy to implement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing a Lexer
&lt;/h2&gt;

&lt;p&gt;Lexer is the simplest part of writing a language, just tokenizing the keywords.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F0%2AAJ0aSU6_OteKX8_t." class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F0%2AAJ0aSU6_OteKX8_t." alt="Lexer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I didn't use any lexer generator (like lex) because its better to make it from zero for me. But the worst part of it, I DON'T KNOW C++. And thats why it was a bit torture to me. I still think the lexer i wrote sucks because i made it without any C++ knowledge. But, atleast it works :D&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;50 100 + put
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;=&amp;gt; (pseudo)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {token: NUMBER, value: "50"},
    {token: NUMBER, value: "100"},
    {token: ADD, value: ""},
    {token: PUT, value: ""}
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Compiler? Transpiler?
&lt;/h2&gt;

&lt;p&gt;After writing a lexer, i need to make a compiler/transpiler for my project. (i skipped AST since it doesn't need.) I checked LLVM but its really deep project to dive in so i tried with assembly. And another problem, i don't know assembly too! and i decided to make a C++ transpiler for my language.&lt;/p&gt;

&lt;p&gt;It transpiles the code into C++ and runs &lt;code&gt;g++&lt;/code&gt; to compile the C++ source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying the Language
&lt;/h2&gt;

&lt;p&gt;I wanted to test the limits of the language, So i made a brainfuck compiler in my language. I think its best project to test your language too.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/aiocat/virna/blob/main/example/brainfuck/brainfuck.vi" rel="noopener noreferrer"&gt;Brainfuck To C&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;After some days, i added tons of things to my language. It was really fun!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FK7ndqP4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FK7ndqP4.png" alt="Features"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;And the most boring thing in programming scenario... Writing a documentation! Well, i think nobody likes that but everyone needs that too. So i wrote a simple language reference for my programming language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finishing
&lt;/h2&gt;

&lt;p&gt;So, that was my adventure about creating a minimal programming language. If you liked the project, you can star on &lt;a href="https://github.com/aiocat/virna" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; page!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cpp</category>
      <category>computerscience</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Best Way To Create Config Files</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Sun, 28 Nov 2021 16:09:51 +0000</pubDate>
      <link>https://forem.com/aiocat/best-way-to-create-config-files-3m55</link>
      <guid>https://forem.com/aiocat/best-way-to-create-config-files-3m55</guid>
      <description>&lt;p&gt;Hello folks! I made a config language 3 days ago to solve other language's problems. Now i wanted to share with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problems
&lt;/h2&gt;

&lt;h3&gt;
  
  
  JSON
&lt;/h3&gt;

&lt;p&gt;JSON is the most popular language to create configs. But JSON is not modern for 2021.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No Comment Support&lt;/li&gt;
&lt;li&gt;Bad Syntax&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  TOML
&lt;/h3&gt;

&lt;p&gt;TOML is another new config language and used by rust's cargo today. TOML solves some problems that JSON has but its still not simple to write.&lt;/p&gt;

&lt;h3&gt;
  
  
  YAML
&lt;/h3&gt;

&lt;p&gt;YAML has same problems that TOML gives, not simple and fast to write.&lt;/p&gt;

&lt;h3&gt;
  
  
  XML
&lt;/h3&gt;

&lt;p&gt;Everyone knows XML sucks for 2021.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snug
&lt;/h2&gt;

&lt;p&gt;And snug... Snug is created for write fast and simple configs with flexible syntax. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num 1 str "Hello, World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets convert this to the JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"num"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"str"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a valid snug file but it looks bad right? Let's fix the syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This is a simple comment, comments are starting with a hashtag and continues until next hashtag. #

num 1
str "Hello, World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Say goodbye to indentation syntax, semicolons and if you want to write worst syntax, new lines.&lt;/p&gt;

&lt;p&gt;Snug also supports object and arrays. Time to give a complex example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This is a comment! #
title "Hello World"
views 4826
is-public yes
owners ["User1" "User2"] # This is an array. #

(content # This is an object. #
text "Hello everyone, how are you?"
sha256-hash "0cfb86e2b382029d9c7ee32e98f855c1e870b688766da19caee32122894db03b"
color 12648430)

allow-edit no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Learning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/aiocat/snug"&gt;GitLab README&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aiocat/snug"&gt;GitHub README (Mirror)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Libraries
&lt;/h2&gt;

&lt;p&gt;Snug has language support problem right now. Only supports Vanilla JavaScript and Python3 (28/11/2021) for now. For contributing to this project, You can create snug libraries for other languages. Also after publishing your library, You can create merge request on GitLab repository to add your library to libraries list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gitlab.com/aiocat/snug#libraries"&gt;Click&lt;/a&gt; for snug libraries.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>python</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Dynamic Windows in Website - JDW</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Sat, 25 Sep 2021 09:54:19 +0000</pubDate>
      <link>https://forem.com/aiocat/dynamic-windows-in-website-jdw-28fh</link>
      <guid>https://forem.com/aiocat/dynamic-windows-in-website-jdw-28fh</guid>
      <description>&lt;p&gt;Hello folks! Today i will show a javascript library for creating dynamic windows in website by me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/aiocat/jdw" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aiocat/jdw" rel="noopener noreferrer"&gt;GitHub Mirror&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;Check &lt;a href="https://gitlab.com/aiocat/jdw-docs" rel="noopener noreferrer"&gt;this repo&lt;/a&gt; for documentation. (if gitlab pages not works, download the source code and run &lt;code&gt;/web/index.html&lt;/code&gt; in your browser.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Let's get the CDN link from the README.md and get started. Of course we need a empty html file first;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- Noto Sans Font --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.googleapis.com"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.gstatic.com"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt;
      &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&amp;amp;display=swap"&lt;/span&gt;
      &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;
    &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- JDW CDN --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/gh/aiocat/jdw@0.0.1/jdw.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can create a window! Let's open a script tag in body and create a simple window like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;jdwindow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JDWindow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 600px width.&lt;/span&gt;
    &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 400px height.&lt;/span&gt;
    &lt;span class="na"&gt;titlebar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Window&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Window title will be "Window".&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Titlebar height.&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;windowCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;background-color: #333; font-family: Noto Sans JP; border: 5px solid #777;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Simple css for window.&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;titleBarCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;background-color: #111; color: #fff;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Simple css for titlebar&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draggable&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Make the window draggable.&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Add the window to the body.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's view the result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FC7gzqLO.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FC7gzqLO.gif" alt="Example Result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Uh, but how we can resize this? JDW also has a utility for this!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;let jdwindow = new JDWindow({
&lt;/span&gt;    width: 600, // 600px width.
    height: 400, // 400px height.
    titlebar: {
        title: "Window", // Window title will be "Window".
        height: 25, // Titlebar height.
    },
});
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;jdwindow.windowCss("background-color: #333; font-family: Noto Sans JP; border: 5px solid #777;"); // Simple css for window.
jdwindow.titleBarCss("background-color: #111; color: #fff;"); // Simple css for titlebar
&lt;/span&gt;&lt;span class="gi"&gt;+ jdwindow.resizable(); // Make the window resizable.
&lt;/span&gt;&lt;span class="p"&gt;jdwindow.draggable(); // Make the window draggable.
&lt;/span&gt;&lt;span class="gd"&gt;- jdwindow.draw(); // Add the window to the body.
&lt;/span&gt;&lt;span class="gi"&gt;+ jdwindow.draw(50, 50); // Add the window to the body with 50px top and 50px left.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's show the result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F4X4Z63j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F4X4Z63j.gif" alt="Example Result 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, we need to add some element to the window. For this, we will use &lt;code&gt;&amp;lt;JDWindow&amp;gt;.addElement(element)&lt;/code&gt; or &lt;code&gt;&amp;lt;JDWindow&amp;gt;.addElements(...element)&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;let jdwindow = new JDWindow({
&lt;/span&gt;    width: 600, // 600px width.
    height: 400, // 400px height.
    titlebar: {
        title: "Window", // Window title will be "Window".
        height: 25, // Titlebar height.
    },
});
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+ let btn = document.createElement("button"); // Create a new element to append.
+ btn.innerText = "Hello!"; // Add a text to the button.
+ btn.onclick = () =&amp;gt; btn.remove(); // Remove the button when clicked.
+ jdwindow.addElement(btn); // Add element to the window.
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;jdwindow.windowCss("background-color: #333; font-family: Noto Sans JP; border: 5px solid #777;"); // Simple css for window.
jdwindow.titleBarCss("background-color: #111; color: #fff;"); // Simple css for titlebar
jdwindow.resizable(); // Make the window resizable.
jdwindow.draggable(); // Make the window draggable.
jdwindow.draw(); // Add the window to the body.
jdwindow.draw(50, 50); // Add the window to the body with 50px top and 50px left.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's test!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F0nuqO8M.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F0nuqO8M.gif" alt="Example Result 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And also, you can customize everything with css! Here an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;jdwindow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JDWindow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;titlebar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Rice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;margin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0 auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;paddingLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#fff&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This is a simple JDW window.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;btn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onclick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addElements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;windowCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-family: Noto Sans JP; border: 2.5px solid #2C3645;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCloseButtonContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;titleCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;color: #434C5E; font-weight: 800; padding-left: 8px;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;height: 100%; background-color: #0D1117; opacity: 0.8;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;titleBarCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;background-color: #161B22; font-family: "Noto Sans JP", sans-serif;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;closeButtonCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;background-color: #EF534F; border-radius: 300px; padding: 8px; border: 0px solid #000; outline: none; margin-right: 10px;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draggable&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;jdwindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FlEr31i8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FlEr31i8.gif" alt="Customize Result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute
&lt;/h2&gt;

&lt;p&gt;Since this project is new, it can have some bugs || errors. If you found a bug or an error, please create an issue in &lt;strong&gt;gitlab&lt;/strong&gt; repository. Read &lt;code&gt;README.md&lt;/code&gt; for more informations.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>window</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Compile your go app cross-platform easily!</title>
      <dc:creator>aiocat</dc:creator>
      <pubDate>Thu, 02 Sep 2021 09:44:15 +0000</pubDate>
      <link>https://forem.com/aiocat/compile-your-go-app-cross-platform-easily-2473</link>
      <guid>https://forem.com/aiocat/compile-your-go-app-cross-platform-easily-2473</guid>
      <description>&lt;p&gt;Hello gophers! when you create an app with go, you also need to compile your app for other platforms and architectures. In go, you need to change environment variables for every compile. So i decided to make a simple tool named &lt;strong&gt;CCGO&lt;/strong&gt; (&lt;strong&gt;C&lt;/strong&gt;ross-platform &lt;strong&gt;C&lt;/strong&gt;ompile for &lt;strong&gt;Go&lt;/strong&gt;) that does this for us!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/aiocat/ccgo"&gt;GitLab Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For now, it compiles your app to &lt;strong&gt;14&lt;/strong&gt; different platform. but you also can make a config yourself!&lt;/p&gt;

&lt;p&gt;It works pretty simple. Download the binary from release page and add to your path.&lt;/p&gt;

&lt;p&gt;Now we can test the app. Lets create a empty dir and initialize our project with &lt;code&gt;go mod init example&lt;/code&gt;. Then we will add a &lt;code&gt;main.go&lt;/code&gt; file that contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now, we can test the ccgo. Lets run the ccgo with &lt;code&gt;ccgo example&lt;/code&gt;. (the &lt;code&gt;example&lt;/code&gt; is the name of the app.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bcgZ9UNW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/jJKjWjH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bcgZ9UNW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/jJKjWjH.png" alt="Example Compiling Photo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It compiled our app successfully. But where is the binaries? CCGO adds the programs to the &lt;code&gt;.ccgo&lt;/code&gt; folder. If you can't see the folder in your project root, Make sure you enabled the see hidden file/folders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ylYMg59I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/PQCdENE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ylYMg59I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/PQCdENE.png" alt="Example CCGO Folder Photo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CCGO also creates a sha1 checksum for your binary:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T2B3WFYj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/LR5jTxZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T2B3WFYj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/LR5jTxZ.png" alt="Example Compiled Folder Photo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also can create our own config. For this, we need to create a file named &lt;code&gt;ccgo.config.json&lt;/code&gt; first. Then we can add the configs to the this JSON file. List of the configs with examples are avaible at gitlab repository &lt;code&gt;README.md&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Thats it! Since I just started yesterday, its current state is not very advanced. Please check the &lt;code&gt;README.md&lt;/code&gt; file from gitlab repository if you want to contribute to this project.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
