Tag: web

Type Hints – Better type at Python

Python is known as a dynamic, strong-typed language. Most developers love it but some feel mad without type checking or type-hinted auto-completion. In Python3.5, Type Hints is introduced to further delight developers who want those features.

Type Hints offers type checking on function parameters, return values and class attributes, as if it’s static-typed. If you pass something does not match the expected type, a warning will be given.

According to The Theory of Type Hints, here’s an example showing how the rules work out in practice:

Say there is an Employee class, and a subclass Manager:

Let’s say variable e is declared with type Employee:

Now it’s OK to assign a Manager instance to e:

It’s not OK to assign an Employee instance to a variable declared with type Manager:

Now, suppose we have a variable whose type is Any :

It’s OK to assign a to Employee e:

Of course it’s also OK to assign Employee e to a:

Continue reading

Basic Open Graph techniques that optimize shared links on Facebook

Open Graph is a good standard, it helps turning a web page to become a rich object in a social graph.
If you follow the Open Graph protocol, most of the social platforms (Facebook, Reddit, etc. ) will crawl your website and present it in a nice and structured format.

A minimal open graph set-up requires these 4 tags:

  • og:title
  • og:type
  • og:url
  • og:image

To start with, implement Open Graph Tags as the followings:

Further optimizing the related Open Graph tags would be an advanced SEO skills for grow hackers.
An eye-catching and structured graph information will positively affect your post exposure.

Facebook with Open Graph

Facebook is one of the leading platform that strongly encourages the use of OG Tags.
On Facebook, you might already notice some shared links are displayed in different forms.

FOMR 1 – IMAGE Grid on left
FORM2 – Top cover Image


Continue reading

UI 101: Simple Rules that make great front-end

We have many pixel lovers at Oursky. We strive for perfection in the UI design process, and most importantly, make sure developers implementing them perfectly.

Here we share our internal 101 guideline for developers, wish it will help more junior developer building Web like a Pro.

Web front-end basic styling tips

Buttons and Labels


  • Buttons / Labels must have same padding for top and bottom, same applies to left and right paddings.
  • Centre align your text.
  • Button should expand itself, don’t forget to apply a minimum width in case the label is very short.
  • For convenience, if the style for the hover state is not given in design, use darken or lighten function for quick and nice effect.

Continue reading

© 2017 Oursky Code Blog

Theme by Anders NorenUp ↑