Skip to content

Instantly share code, notes, and snippets.

@xoptgah
xoptgah / notes.js
Created January 23, 2019 01:26
Javascript Notes Book
// You can use console.log() in combination with placeholders:
var greet = "Hello", who = "World"; console.log("%s, %s!", greet, who);
@xoptgah
xoptgah / course_snippets.js
Created January 12, 2019 14:39
Java Script Course snippets
use strict
@xoptgah
xoptgah / php_url_parse.php
Last active December 13, 2018 08:53
PHP url snipp #PHP
<?php
// Examples for URL: https://example.com/subFolder/yourfile.php?var=blabla#12345
//built-in function
$x = parse_url($url);
$x['scheme'] 🡺 https
$x['host'] 🡺 example.com (or with WWW)
$x['path'] 🡺 /subFolder/yourfile.php
$x['query'] 🡺 var=blabla
$x['fragment'] 🡺 12345 // hashtag outputed only in case, when hashtag-containing string was manually passed to function, otherwise PHP is unable to recognise hashtags in $_SERVER