Skip to content

Instantly share code, notes, and snippets.

View bronhy's full-sized avatar

Marko Antolović bronhy

View GitHub Profile
@bronhy
bronhy / bash.sh
Last active January 4, 2019 09:43
Streaming with XMLHttpRequest
docker run -d -p 8090:80 -v ${PWD}:/var/www/html/ php:7.3-apache
@bronhy
bronhy / new-keyword-function.js
Created July 11, 2018 16:45
An implementation of the new Keyword in Javascript
function NEW(constructor, argsArray) {
var obj = {}; // step 1
obj.__proto__ = constructor.prototype; // step 2
constructor.apply(obj, argsArray); // step 3
return obj; // step 4
}
function Parent(name) {
this.name = name;
}
Parent.prototype.greet = function() {
var Greeter = /** @class */ (function () {
function Greeter(message) {
this.greeting = message;
}
Greeter.prototype.greet = function () {
return "Hello, " + this.greeting;
};
return Greeter;
}());
var greeter = new Greeter("world");
@bronhy
bronhy / xdebug_php.ini
Last active October 25, 2018 08:19
PHP ini setting for activating xdebug
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.idekey=PHPSTORM
@bronhy
bronhy / unix-commands.md
Last active October 25, 2018 08:18
Unix & Mac commands

Cheet Sheet of unix/mac commands

Force quit

cmd + alt + esc

Find command

find <source-path> -name "Y"
@bronhy
bronhy / sf-commands.md
Last active July 5, 2018 12:29
Syfmony commands

Cheet sheet of symfony commands

Create new project

composer create project symfony/skeleton .

Install Symfony server

composer require server
@bronhy
bronhy / git-commands.md
Last active May 17, 2018 10:10
Git commands

Cheet Sheet of git commands

Prune all unreachable objects from the object database

git remote prune origin
git push origin --delete <branch>
git branch -D <branch>

Delete remote branch

@bronhy
bronhy / apache-snippets.md
Last active February 21, 2018 16:23
Apache snippets

Creating basic auth

Create the password file

htpasswd -m -c librarians jim
# New password:
# Re-type new password

htpasswd -m librarians carla
# New password:
@bronhy
bronhy / php-snippets.md
Last active February 21, 2018 20:32
PHP snippets

Dump methods on object

var_dump(get_class_methods(get_class($object)));

Property exists

var_dump(property_exists($data, 'propertyName'));

PHP Unit configuration

@bronhy
bronhy / angular.md
Last active June 16, 2018 14:30
Angular

Commands

Install angular cli

npm install -g angular-cli

Create application with cli tool

ng new applicationName