Upload files on GitHub using Github.js

Upload files on GitHub using Github.js

For a few months now, I have been working on a project that employs the GitHub APIs. The application I’m building is completely client-side and provides a feature to upload files to a repository on GitHub. To simplify the interaction with the API, I’m using a library called Github.js.

In this article, I’ll explain how to upload any file on a repository on GitHub using Github.js and discuss a couple of major issues you might face. If you want to see (a better version of) the code developed for this article in action, you can browse and download it from the repository I’ve created on GitHub.

Trick of the day: CSS Scroll Snap Points

Trick of the day: CSS Scroll Snap Points

When you create a gallery, you usually want to implement a feature where every time the user clicks (or press the ENTER key) on an arrow, you move straight to the next (or previous) image. This effect can also be used to create a website that has several sections, each of which takes the full window’s height, where at each scroll you move the user to a new section. To achieve this goal, developers have always used JavaScript but the W3C has proposed a new standard called CSS Scroll Snap Points.

Trick of the day: The time element

Trick of the day: The time element

HTML5 introduced several new elements to address many common use cases that developers have faced over the years. As an example you can think to the new audio and video elements that allow you to avoid the use of third-party software like Flash and Silverlight to play audios and videos. While media streams play an important role on the web, the W3C and the WHATWG have also tried to enhance the semantic of web pages. One of these new elements is the time element.

Trick of the day: Undoing mistakes in Git

Trick of the day: Undoing mistakes in Git

Everyone can make a mistake and Git is probably one of the easiest technologies ever where mistakes happen. Sometimes you or other developers commit things that weren’t supposed to be committed or even push them on the remote repository. Usually, once something is pushed you don’t want to mess up with the commit history, but under some circumstances this is totally acceptable. When this happens, you might need a guide to know exactly what to do.

Trick of the day: Memoization in JavaScript

Trick of the day: Memoization in JavaScript

Functions in JavaScript are really different from many other languages as they are first-class citizens. What this means is that they are treated like any other data type, including objects (actually they are objects), and as such functions can possess properties and even functions, can be assigned to variables, and can be passed to other as an argument. In addition, they can be executed which is really what make functions different from other objects.

Trick of the day: Sass, Mixin or Placeholder?

Trick of the day: Sass, Mixin or Placeholder?

Without any doubt, two of the best and most useful features of Sass are mixins and placeholders. A mixin is a directive similar to a function in programming languages in that you can pass arguments. However, a mixin outputs CSS code instead of returning a value as the result of its execution. A placeholder is similar to an abstract class of an object oriented language. When your Sass code is compiled, the body of a placeholder isn’t included in the CSS code unless there’s a CSS class extending the placeholder.

Job Offers Errors and How to Avoid Them

Job Offers Errors and How to Avoid Them

As we all know, IT is a growing field and it’s easy to find a job (at least compared to other fields). We’re overwhelmed by job offers and recruiters emails sent to find the right person for their clients. Unfortunately, many of these offers are written by people without any clue of what they are talking about. Others are written without the will to end up something meaningful and appealing. This is really sad as it wastes people’s time and it’s also counterproductive for the companies. Most of the time the only result these job offers will have is to let potential candidates down, thus avoiding applying for the role.

In this article, I’ll discuss some of the most common job offers errors I’ve found recently on the web and how to fix them.