Showing posts with label frontend. Show all posts
Showing posts with label frontend. Show all posts

Friday, 8 May 2015

ex Unit, Commercial bread, Deleting a GitHub Repo

Ex Unit

As well as the units px and em there is also ex which the height of the X in that typeface.

Commercial Bread

Instead of just plopping the dough into the tin, it's rolled and then cut into four pieces which are placed in the tin. This makes the bread less likely to rip when being buttered.

Deleting a GitHub Repo

I needed to test some code today, and in order to do so I needed to put up a pull request and then delete the repo the branch was in. Fortunately the GitHub instructions were nice and easy to follow, and even though I have nothing of interest in any of my repos on GitHub it was still slightly scary to do!

Tuesday, 28 April 2015

Shoes on the Bank of the Danube, iframes, The Fold

Shoes on the Bank of the Danube

Today I read about the sculpture of shoes on the bank of the Danube in Budapest, where 70 years ago Jews were forced to take off their shoes before being shot so they fell into the Danube which carried their bodies away. The article The Shoes on the Danube Promenade – Commemoration of the Tragedy goes into more detail.

iframes

When you use an iframe on a page, it can access things on the page. However if the content on the iframe is from a different server, security protocols kick in and the iframe no longer has access to the rest of the page.

The Fold

Where is the fold? The website I am the fold measures the window height of all visitors to the site showing a large range of sizes. Gave me something to think about concerning designing for the fold, when it's not at all clear where it might be.

Monday, 20 April 2015

Tardigrades, The Command Key and Keyup, TypeScript Classes, Goats in Rwanda

1. Tardigrades

Tardigrades are tiny creatures, around 1mm long that can survive extreme conditions. Some were sent into space on a satellite and not only did many of them survive but they even had healthy young.

These remarkable creatures can survive in a dehydrated state of suspended animation and can even repair damaged DNA when they come out of it. Some of them can survive radiation, extreme heat and extreme cold.

3. TypeScript Classes

The following is a TypeScript class

class Something {
  thing: string;
  constructor (thing: string){
    this.thing = thing;  
  }
}
var something = new Something ('whatever');

which produces the JavaScript

var Something = (function () {
  function Something () {
    this.thing = thing;  
  }
  return Something;
})();

var something = new Something ('whatever');

However, there is a simpler version of the TypeScript that will give the same result.

class Something {
  constructor (private thing: string){  
  }
}
var something = new Something ('whatever');
You can also make it public, which again results in the same JavaScript.
class Something {
  constructor (public thing: string){  
  }
}
var something = new Something ('whatever');

Although the JavaScript is the same, TypeScript will catch errors related to the private field. Note that everything is public by default.

Hope and Inspiration

Goats in Rwanda

It's easy to get bogged down by all the bad news and negative things highlighted around us so I'm going to add a section on stories, blog posts, articles that I find bring hope. The first of these is an article about a family in Rwanda who received a goat from a charity called Heifer International five years ago. It was a life changing event for the family.

Heifer International is an organisation which trains people in better farming practices along with giving them animals and tools to get started. Receiving an animal means the family gets increased food supplies directly through milk or eggs and indirectly through the increased yields of their crops through fertiliser made from dung.

There are other organisation which do this, but the principle that I particularly like about this organisation and their sister organisation Send A Cow, is the "pass it on" principle. The first female offspring of any animal they receive, along with training is passed on to another person, so not only is the first person helped, but they participate in helping another, and the chain continues.

This whole process has dramatic effects on the families receiving gifts. Their health improves through better nutrition. They receive extra income from the abundance of produce. They can afford to send their children to school.

Thursday, 9 April 2015

Plus Symbol, Symbol, Gulp

1. The Plus Symbol

The plus symbol + comes from the letter t in Latin word et meaning and.

2. Symbol

The word symbol comes from the Greek word for token or token of identity. This word is made up from two Greek words sum (together) and ballo (to throw). In ancient times, a stick or bone was broken into two and each party took a piece. The pieces were a symbol of the relationship, confirmed by the two pieces fitting perfectly together.

3. Gulp

I've just started the edX TypeScript course. So far I'm enjoying it although it's quite challenging. In the second lesson, there's a rather large jump with some missing information, but with the help of a link in the forums to a blog post I was able to set up a typeScript workflow using gulp.

What is significant about this for me is that two months ago I have no idea how build scripts worked. They were in the scary mystery bucket. To make a small change to some code, I needed to understand the build process, and so I'd worked my way through the project's grunt file. Grunt is, like gulp, a build task runner. Because of their similarity, I understood, at least on a surface level, what the gulp file was doing. I'd learnt more than I thought I had!