Stay away from troubles with security best practices when using AI coding agents.| Land of Unknwon
One-shot from an empty directory, which AI agent will stand out?| Land of Unknwon
How we used Pulumi to practice Infrastructure as Code with DigitalOcean| Land of Unknwon
In Software Engieerning, we all have seen this meme: It’s not only about writing the code, but also being able to be reviewed effectively by peers. Therefore, pull requests with smaller diffs are always preferred. However, developers face many challenges when actually practicing this approach, especially when doing it with as-of-now the most popular code collaboration mode, trunk-based development. In particular, smaller diffs means more pull requests for a serie of changes that are depende...| unknwon.io
Crack things before you're feeling ready.| unknwon.io
Great thanks to @bketelsen for correcting grammar. This post is also a guest post on Gopher Academy Blog. This post is published corresponding to the Gogs - Go Git Service v0.2.0 release. First, please let me speak for the develop team to thank all of our friends who are supporting us on GitHub. As you may know, v0.2.0 is the first public release of Gogs, and the community has contributed over 650 stars to this project on GitHub in just one week.| unknwon.io
Preface Frankly, I did not expect to have another blog post so soon after the lengthy one just one year ago. However, what has happened over the last year at Sourcegraph was huge, some chaos, some excitement, and of course led me to some thinking (which is good). Therefore, I decided to write another blog post focusing on my career learnings and thoughts, as a way of celebrating my fourth anniversary of both working at Sourcegraph and my professional career.| unknwon.io
My story with Sourcegraph An email from a random cool guy The story all started with an email, it was 2013, and I just started learning Go, wrote a website (which has been archived after running it for 9 years) to practice my knowledge, and someone named “sqs” shot me some lines around “Hey, the website you built looks cool, we at Sourcegraph are doing something similar, we should definitely chat.| unknwon.io
Being persistent is better than being clever. The beginning Around 2011, I cound’t remember why I installed Any.do from Chrome Web Store but it became the first ToDo app I’ve ever used. It was dead simple, just a list of tasks with date views like Today, Tomorrow, Upcoming, and Someday. Pretty much the same as what it offers today (just few seconds ago I looked at it). One thing I could never forget about Any.| unknwon.io
This blog post is inspired by the conversation of adding background repository migration to Gogs. Why and when? Dave Cheney talked about petty much the “Why and when” parts in his Talk, then code, I recommend reading it if you ever want to make a meaningful contribution to an open source project. The more I work in the software engineering field, the more I admire the fact that most of time is and should be spent on articulating and communicating my ideas, both to other people and to my f...| unknwon.io
I did not pay attention to M1-chip MacBooks when they were first being announced in 2020 because I believed it was too cutting-edge and the ecoysystem needs time to catch up, which in hindsight was a right call. In fact, I even made the decision later same year to get a top-tier MacBook Pro 16 with the Intel-chip to upgrade my home office setup. This year, for some reasons, maybe because I got a Mi Box and watched too many YouTube videos talking about how performant M1-chips are, made me watc...| unknwon.io
Background I had used “Sourcegraph Campaigns” once that I migrated all of my personal repositories from Travis CI to GitHub Actions, which is now branded as Sourcegraph Batch Changes. If this is the first time you heard about it, it is, in my own words, a toolset to create and manage content changes across many, could be dozens if not thousands of repositories. This time, I want to run tests in CI with Go 1.| unknwon.io
Background I need to set up two GitLab that uses same SSO (Keycloak) and wire up with Sourcegraph to test repository permissions. This is my ops log for doing it. Because both GitLab SAML OmniAuth Provider and Keycloak require HTTPS and I’m so used to just use Caddy to set up such thing with Let’s Encrypt, so I create one GCP VM for each GitLab and Keycloak instances and assign them with some subdomains.| unknwon.io
This post was originally published on https://thenewstack.io/building-a-web-server-in-go/ Go (Golang.org) is the system programming language that provides standard HTTP protocol support in its standard library, which makes it easy for developers to build and get a web server running very quickly. Meanwhile, Go offers developers a lot of flexibility. In this post, we lay out several ways to build an HTTP web server in Go and then offer an analysis about how and why these different approaches a...| unknwon.io
This post is published corresponding to the Gogs 0.10 release. First things first, you may have noticed there are some notable changes to the branding of Gogs project: New logo: great thanks to its designer Egon Elbre. Please also take a look at his brilliant art-work of Gophers, you will love them. Simplified tagline: it is just Gogs, no Go Git Service anymore (you can still use it if that makes sense to you), and NOT GoGS (this is 100% wrong!| unknwon.io
This post is published corresponding to the Gogs - Go Git Service v0.8.0 release. It has been over a year since last release post, mainly because there are too much work undergoing and plans are completely outdated. Fortunately, most of things finally get done in this big release. From last post of release (v0.5.0), almost 1.8k commits with tons of improvements, bug fixes, new features and others are added to Gogs.| unknwon.io
There are two ways to use HTTPS for Gogs based on the way you choose to deploy: Reverse proxy, e.g. NGINX, Caddy Expose Gogs on the internet directly And there are two types of HTTPS certificates: real and pretend to be real. So, let’s talk about how to get your HTTPS certificates. Obtain HTTPS Certificates Buy business version (OH PLEASE!!! Donate a million or two to Gogs project 😊) Apply free version from Let’s Encrypt or StartSSL Self-signed You can Google (I just happened to be laz...| unknwon.io
This post is published corresponding to the Gogs - Go Git Service v0.5.0 release. After a whole summer, we finally go from Alpha to Beta with a new release. In this release, we introduced some major features like Organization, Multiple Languages and new UI, and we’re receving contributions from more developers which make contributors of Gogs to be 55. Please Change Log for full list of changes in this release.| unknwon.io
Introduction Go comes with built-in unit test feature, and there are lots of third-party helper libraries before GoConvey was born. Unfortunately, none of them can help you write elegant test cases like GoConvey does, simple syntax and comfortable interface make you fall in love with writing unit tests. Installation go get github.com/smartystreets/goconvey API Documentation Please visit Go Walker. Basic Usages Write the code Following code shows an example of basic four arithmetic(Add, subtra...| unknwon.io
This post is for someone like me who just get started with VIM, and because the original plugin author doesn’t given detailed steps about how to setup his awesome work, here I am. NOTICE This is not a post about how to install Go. VIM plugin we use: github.com/fatih/vim-go Install Pathogen Pathogen is a plugin manager of VIM, which tons of plugins support it. So, one time forever, let’s install it.| unknwon.io
Transaction Sample code 1 This part is based on last post XORM - Go ORM: basic guide and make some improvements in sample code. In the last post, the transfer part didn’t use transcation to make operation safe, and now it is: // Create Session object. sess := x.NewSession() defer sess.Close() // Start transcation. if err = sess.Begin(); err != nil { return err } if _, err = sess.| unknwon.io
This post is published corresponding to the Gogs - Go Git Service v0.4.1 release. In the very beginning of this post, I want to speak for the develop team say sorry to all Gogs users: No matter if you’ve ever noticed in Trello board, we’re sorry to say that the organization feature didn’t implement in this release. This is caused by limited of team members in this period, but we’re sure about to provide this feature in 0.| unknwon.io
Introduction xorm is a Go ORM which provides rich functionality with very simple APIs. It supports all main stream databases, including MySQL, PostgreSQL, SQLite3 and MsSQL. It allows you use chain operations and combine with raw SQL statements. Moreover, it has session that supports transactions to make your business logic safe. Installation go get github.com/go-xorm/xorm API Documentation Please visit Go Walker. Basic Usages Sample Code Define model You have to define model before using the...| unknwon.io
This post is published corresponding to the Gogs - Go Git Service v0.3.0 release. After hard working of more than half of month, Gogs finally gets into a very important release: v0.3.0. There are couple of reasons that why I say this release is important: We start receiving advice and feedback from users after first public release, which makes Gogs make more improvements and less bugs. This release adds a lot of new features, including private repository, migrate or mirror repository, ship wi...| unknwon.io