Alternative to Github

GitHub came into existence in early 2008 and radically changed the way source code management is handled. GitHub is a web-based version control repository that uses the Git system of source control management, giving the developers a user-friendly interface to manage their code. Today, GitHub is one of the top Git products, being used by both open source developers, to development teams in large corporations.

GitHub allows anyone to host their code, as long as it’s public. If you want to have private repositories, you must sign up for a paid plan. Students can take advantage of their student plans to get free private repositories, amongst other goodies.

However, there are good alternatives to GitHub that offer the same features, but allow for free repositories. Some of the big ones are described below:

  1. Bit Bucket (By Atlassian)

    Atlassian, the creator of one of the widely used scrum management tool – Jira, have their own Git based source management product. Bit Bucket is a great alternative to GitHub as it provides most of the features provided by GitHub, but also allows for private repos under the free plan. The UI is not as appealing as GitHub’s and the search functionality can use more work. But for a free product, Bit Bucket is great!

  2. GitLab

    Not to be confused by the similar sounding name, GitLab is a completely separate project, managed by a completely different team. GitLab provides more features than GitHub, and like Bit Bucket allow for unlimited private repositories. However the performance is no where near GitHub.

  3. Beanstalk

    BeanStalk is another code management tool that doesn’t require downloading any tool. It is being run by the software company Wildbit. BeanStalk advertises themselves as more than just source management, as it comes packaged with a few deployment tools and processes lacking in GitHub and Bit Bucket.

  4. Apache Allura

    Apache Allura has the benefit of being an Apache Foundation project, but it is a relatively new project. Apache  Allura supports Git, SVN and Hg for code management. The search functionality is more powerful than that of GitLab, but the UI could use more work. It is a free and open source, however it is not hosted. You get the software, and require setting it up on your own server. This is a big disadvantage compared to the other.

References
  1. Git – Wikipedia
  2. GitHub
  3. GitHub Student Plans
  4. BeanStalk

Hibernate Database Creation properties

Hibernate is a powerful open source java persistence framework. One of it’s feature is that it can automatically create your databases for you based on your code.
When you set the hibernate.hbm2dll.auto property, it allows you to either update, create, create-drop or validate your schema.

From the community documentation:

hibernate.hbm2ddl.auto Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

e.g. validate | update | create | create-drop

The legal options are :

    • validate: validate the schema, makes no changes to the database.
    • update: update the schema.
    • create: creates the schema, destroying previous data.
    • create-drop: drop the schema when the SessionFactory is closed explicitly, typically when the application is stopped.

Testing your APIs with POSTMAN

Anyone who develops anything knows that they need tools to test their product. Developing APIs is no different. In order to ensure that you are releasing something that actually works, you need to test your APIs by hitting the endpoints and validating the responses.

I’ve been using POSTMAN to do this task for me. It is a clean, free tool that lets you send requests to your API, with full control on what’s sent (headers, content) and shows the full responses. It also saves your history so you can test an endpoint without having to retype the parameters over and over again.

 

Give POSTMAN a try, and let me know if you are using something else.

Creating Temporary Files in C#

Many programs create temporary files on your computer while they’re running. Temporary files are used to save data that’s either too large to be stored in memory, or need to be accessed by different resources, or needs to be persisted to allow smoother running of the application (almost like a cache).

Temporary files are stored under AppData/Local/Temp. The path is usually set in environment variables, and can be changed. If you go to %tmp% you’ll see a whole bunch of folders and files generated by various programs running on your machine.

If you need to create temporary files in your application, you can leverage the powerful System.IO.Path class.

Using Path.GetTempPath() will create a temporary file with a random* name in the temporary folder, and return the name of the newly created file.

It is the developer’s responsbility to either delete the file when it’s done being used, or leave it to the user to run disk cleaner.

If you need to create the temporary file for a specific use case and ensure it’s deleted, you can use FileOptions.DeleteOnClose option when creating your FileStream:


using (FileStream fs = new FileStream(Path.GetTempFileName(), 
       FileMode.Open, FileAccess.ReadWrite, FileShare.None, 4096, 
       FileOptions.DeleteOnClose))
{
    //To Something with the file
}//File no longer exists

References:

  1. MSDN

Create beautiful GIF user guides

A picture is worth a 1000 words. Pictures are very useful in conveying a message to a diverse use base. You often see images in user manuals, explaining some of the more complicated tasks.

Animation and Videos are worth more than static images! Now instead of taking 10 screenshots to show a process, you can capture the screen and record the process. There are a heap of tools available in the market that allow you to record your screen. However, hosting videos are often complicated, and require plugins to view.

With ScreenToGif, you can record the screen and turn it into a high resolution Gif, allowing you to embed the animated pictures to your user guides.

ScreenToGif recorder screenshot

 

ScreenToGif is open source, and free to download.

Next time you find yourself looking for tools to download to capture your screen, try ScreenToGif and create pictures instead of videos!

References:

https://github.com/NickeManarin/ScreenToGif