Showing 41 to 50 of 55 posts.

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.



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


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.



Encrypt and decrypt string of text example with Node JS in 5 steps

Posted on April 4th, 2019 in NodeJS by George

Cryptography is about constructing and analyzing protocols that prevent third parties or the public from reading private messages. Various aspects of information security such as data confidentialitydata integrityauthentication, and non-repudiation are central to modern cryptography. Node package library offers a few alternatives for encryption. In this example will use 

npm install node-rsa


Drush commands you need to know

Posted on March 24th, 2019 in Drupal by George

5 Drush commands you need to know to be able to manage Drupal websites from drush command line shell.

Visit for all available commands. 



React mixins, Why use mixins?

Posted on January 23rd, 2019 in JavaScript by George

First of all, the reason for wich I would avoid to use mixins is that you ar are bound to use React.createClass() or create-class-module, ES6 classes are not compatibile with React mixins. 

If you are not familiar with how mixins look like, take a look at the following example:


var PureRenderMixin = require('react-addons-pure-render-mixin');

var Button = React.createClass({
  mixins: [PureRenderMixin],

  // ...





How to center fixed elements with JavaScript and jQuery

Posted on November 20th, 2018 in JavaScript by George

Sometime using top, right, bottom and left on a fixed element is not enough. 

I am sure you have been in the situation when you want to center a div container, image or other any html element which is position fixed.  In this article you will find out how to center any block element in the center of the screen using JavaScript and jQuery.

This is going to be achived using jQuery but can be done with plain JavaScript as well.

Follow the article to find out more.


Twig basic syntax, variables, filters and functions

Posted on October 26th, 2018 in Miscellaneous by George

Learn the basic syntax and how to declare variables, use filters and functions with twig. Twig has two delimiters :

If you want to try the code go to TWIG PLAYGROUND and for full reference on functions go to Twig Functions .

For full reference on twig go to Twig Documentation.

1. {%        %}  used to execute statements such as for-loops and filters;

2. {{         }} used to print the result of an expression to the templatep;


Reflection api example, inheritance and how to inspect private methods

Posted on October 21st, 2018 in PhP by George

Here is an example of PHP Reflection api and class inheritance. This example will cover a lot of things like getDocComment() method of reflection api and insanceof plus other things. In order to make sense of the code read the comments. Caveats: getDocComment will return only comments declared on the global scope of the namesapce/document in case. The comment must start in this form with double asterix /** and end */; 


Hash Table in Javascript

Posted on October 9th, 2018 in JavaScript

Dummy hash table for freeCodeCamp.