Image for post
Image for post

0. Introduction

In this tutorial, I am going to share my experiences in creating a UMD JavaScript library that can be used everywhere, the library is compatible with AMD (Asynchronous Module Definition) and CommonJS ecosystems, and can also be loaded in <script> tag.

For more information about AMD, CommonJS and UMD, David Calhoun wrote a great blog that compared them, it’s highly recommended for a read.

Ok, let’s get started!

1. Create a JavaScript library

We are going to create a super simple calculator :)

Go to Github and create a new project called calculator, initialize the repository with a README, .gitignore, and choose a license.


Image for post
Image for post

Introduction

Every time when I got a new computer or reinstalled the macOS, the first thing I would like to do is to set up my terminal and make it look cool. There are several tools I always like to gear up for the terminal including the following:

  • iTerm2
  • Oh My Zsh
  • Powerlevel10k (The coolest theme for Zsh)
  • Vim Airline (Vim status bar)
  • NERDTree (A file system tree for Vim)
  • FZF (fuzzy finder)

There are already a lot of great articles that teach people how to install and configure the above tools, however, in order to set them up correctly, usually I need to refer to at least 5 separate articles and it took me a while to figure out the necessary steps, and most importantly I don’t remember what I did last time. So I decided to put all I have learned together and write them down, this article will show you how to install and configure all the above tools with necessary and concrete steps, and hope it helps. …


Learn how to create a pod from scratch and utilize Travis and Codecov to make the pod robust.

Image for post
Image for post

Introduction

As an iOS developer, you may have used a few CocoaPods libraries in your project, and you may have been very familiar with how to install them and call their methods. However, have you ever dreamed of contributing to the iOS open-source community by distributing your own pod(CocoaPods library)? Imagine many iOS apps are going to use your awesome library, isn’t that fantastic?

In this tutorial, I will show you how to distribute a simple pod. In addition to that, you will also learn how to leverage Travis CI and Codecov to make sure your pod is reliable and robust.

Overview

There are many different ways to create a pod. …


Learning how to use productivity tools will save you a great amount of time

Image for post
Image for post

Preface

Have you ever thought about open source your awesome React components? Follow this tutorial and you will learn how to use some of the best productivity tools to help you scaffold a project, write a React component and publish it to NPM so that it can be used by developers around the world.

Things Required

First, let’s think about what we need before writing any code, below is a list of the basic requirement for open-sourcing a React component:

  • Babel and Webpack

Although they are not necessary, they will make your life much easier. Babel allows you to use modules, JSX with ES6 syntax. Webpack allows you to hot reload the component during the development using HMR(Hot Module Replacement), you can plug in Sass loader to make writing CSS with better experience, and use the Uglify plugin to minify your JavaScript codes. Also Webpack helps you bundle the final assets for distribution. …


Image for post
Image for post

🎉 Finally the CocoaPod is released! See here.

This is a simple iOS project demonstrates how to implement collapsible table section programmatically, that is no main storyboard, no XIB, no need to register nib, just pure Swift 3!

In this project, the table view automatically resizes the height of the rows to fit the content in each cell, and the custom cell is also implemented programmatically.

The source code can be found on my Github.

How to implement collapsible table sections?

Let’s say we have the following data that is grouped to different sections, each section is a Section object:

collapsed indicates whether the current section is collapsed or not, by default is false. …

About

Yong Su

Code Monkey @ Github; Problem Solver @ LeetCode; https://github.com/jeantimex

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store