Skip to content

Instantly share code, notes, and snippets.

View Nagibaba's full-sized avatar
💭
Bilmək olmaz

Babak Naghiyev Nagibaba

💭
Bilmək olmaz
  • Azerbaijan
View GitHub Profile
@Nagibaba
Nagibaba / asynchronous.js
Created April 11, 2019 13:28 — forked from joepie91/asynchronous.js
PHP vs Node.js: Synchronous vs Asynchronous
console.log("Before the first file is read.");
hypotheticalFileGetContents("sample.txt", function(fileContents){
// fileContents now contains the file contents, this function is only called when the file read in the background has finished
console.log("After the first file has completed reading.");
});
// You've now told it to start the first read, but it won't 'block' your script execution. It will do the read in the background, and immediately move on with the rest of your code.
console.log("Before the second file is read.");
hypotheticalFileGetContents("sample2.txt", function(fileContents){
'use strict';
/*
# Javascript Prototyping Best Practices
* To create a class, create a constructor function with a `Name` and assign
it to a variable of the same `Name`.
* In this constructor only define properties using `this.prop` notation
@Nagibaba
Nagibaba / azercell-landing-page-v3.markdown
Last active July 23, 2018 12:58
Azercell landing page v3
@Nagibaba
Nagibaba / azercell-landing-1.markdown
Last active May 1, 2018 09:22
Azercell Landing 1
@Nagibaba
Nagibaba / placeholder-svg.php
Created April 20, 2018 19:48 — forked from james2doyle/placeholder-svg.php
Create simple placeholder images using SVG
<?php
// Usage: <img src="placeholder-svg.php?wh=400x400&fill=bada55&color=000000&font=Georgia&size=20" />
$wh = explode('x', $_GET['wh']);
$wh[0] = (int)$wh[0];
$wh[1] = (int)$wh[1];
$fill = isset($_GET['fill']) ? $_GET['fill']: '666666';
$color = isset($_GET['color']) ? $_GET['color']: 'FFFFFF';
$size = isset($_GET['size']) ? (int)$_GET['size']: 60;
$fontfamily = isset($_GET['font']) ? $_GET['font']: 'Arial';
header('Content-Type: image/svg+xml');