Blog

Showing 11 to 20 of 32 posts.

Swift 5 / 5.1 Enumeration with enum and enum method example

Posted on November 23rd, 2019 in Swift by George

 

In this example, I will create an enumeration using "enum" and a method "compareVales".

The compare value method will return a text string to show which value has primacy based on a predefined Rank.

Read more...

Square Area and Circle Area in Swift 5 and Swift 5.1

Posted on November 23rd, 2019 by George

 

Examples on how to create a class Shape and then subclasses Square and Circle and how to use methods inheritance.

The examples contain methods to calculate the area for a Square and a Circle. 

Read more...

How looks like a tuple in Swift? What is touple? Touples and Swift 5.1

Posted on November 19th, 2019 in Swift by George

 

Touples are used for grouping data.

You can think of it as a data structure much like an array.

Check out in the article a Swift example with explanatory comments.

Read more...

Create a new git repository from command line (curl)

Posted on November 18th, 2019 in Miscellaneous by George

 

Do you find yourself having often to create a new project and also have to create a git repository for it?

Would you rather create the repository on the command line instead of a tedious trip to the GitHub website or locally installed git client? 

Only one line in terminal ...

curl -u 'yourGithubUserNameHere' https://api.github.com/user/repos -d '{"name":"newRepositoryName"}'

Read more...

HTML link phone/mobile number, make it callable

Posted on November 16th, 2019 in Miscellaneous by George

HTML5 includes protocols such as tel: or mailto: for the browser to use. The browsers implement differently the protocols, some will launch the phone app and add the number ready to be used and others directly execute the call if permission is granted.

Read more...

smallest multiple shortest solution JavaScript

Posted on October 2nd, 2019 in JavaScript by George

function sM(v,p) {
const g=(a,b)=>b===0||a===0?a+b:g(b,a%b),l=(a,b)=>a*b/g(a,b);
let m=p?v:1,x=p?p:v,c=m;
while(m<x)c=l(c,++m);
return c;
}

// provide one or two numbers(subsequent)
sM(23);
sM(18,23);

Read more...

Falling letters tutorial css, javascript

Posted on September 22nd, 2019 in Miscellaneous by George

Vanilla js letters and words falling animation

Read more...

Get methods of an object PHP

Posted on September 22nd, 2019 in PhP by George

 

Easy way to inspect the available methods of an object in PHP by using get_class and get_class_methods built-in functions.

 

Read more...

Linux Symlink Folder (soft link, symbolic link) Eloquent explanation

Posted on June 19th, 2019 by George

Create a  symbolic link (symlink):

ln - create link between files (hard link)
ln -s - create symbolic link instead of hard link

Read more...

JavaScript Async function and Await

Posted on April 26th, 2019 by George

 

 

Async/await gives to JavaScript function the ability to be paused and then resumed again when the value is resolved or rejected and then returned to await part, inside of the body of the function.

 

Read more...

Categories