Skip to content

Instantly share code, notes, and snippets.

Elvis Sedic esedic

Block or report user

Report or block esedic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@esedic
esedic / spinner.svg
Created Sep 16, 2019
SVG spinner/loader
View spinner.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Joomla_php_error_handling.txt
Source: https://joomla.stackexchange.com/questions/223/whats-the-correct-way-for-exception-handling/294#294
-----------------------------------------------------------------------------------------------------------
VERSION 1 (https://joomla.stackexchange.com/a/294/1562):
-----------------------------------------------------------------------------------------------------------
There are two types of errors:
Recoverable
Unrecoverable.
@esedic
esedic / media_queries.css
Created Sep 16, 2019
Media Queries for Standard Devices
View media_queries.css
/*! Phones and Handhelds */
/*! ======================================================================== */
/* iPhones */
/* ----------- iPhone 4 and 4S ----------- */
/* Portrait and Landscape */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
@esedic
esedic / wp_snippets.php
Last active Sep 13, 2019
Wordpress snippets
View wp_snippets.php
<?php
// hide admin bar
show_admin_bar( false );
// Remove ACF for non admin users
function remove_acf(){
if( wp_get_current_user()->ID != 1 ) {
remove_menu_page( 'edit.php?post_type=acf' );
}
View css-layout-hack.js
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'<style>* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@esedic
esedic / polyfills.js
Created Sep 7, 2019
Polyfill bundle, loading only if feature is not supported by browser
View polyfills.js
// https://polyfill.io/v3/polyfill.js?flags=gated&features=IntersectionObserver%2CHTMLPictureElement%2CMutationObserver%2CPromise%2CResizeObserver%2Cdocument.getElementsByClassName%2Cdocument.querySelector%2CmatchMedia%2CrequestAnimationFrame%2CIntersectionObserverEntry%2C%7Ehtml5-elements
/* Polyfills included:
HTMLPictureElement
IntersectionObserver
IntersectionObserverEntry
MutationObserver
Promise
ResizeObserver
document.getElementsByClassName
@esedic
esedic / detect_touch.js
Created Sep 6, 2019
Various JavaScript methods for detecting touch/mobile devices
View detect_touch.js
// Method 1
var isTouchDevice =
(('ontouchstart' in window) ||
(navigator.MaxTouchPoints > 0) ||
(navigator.msMaxTouchPoints > 0));
if(!isTouchDevice){
console.log('is not touch');
}else{
console.log('is touch');
}
@esedic
esedic / git-list-commit-files.txt
Created Aug 28, 2019
List all the files in git commit
View git-list-commit-files.txt
$ git diff-tree --no-commit-id --name-only -r bd61ad98
@esedic
esedic / redirect_msg.php
Last active Aug 26, 2019
Joomla system message after redirect
View redirect_msg.php
<?php
$app = JFactory::getApplication();
$app->enqueueMessage('Redirect to another page was successful', 'success');
$app->redirect(JRoute::_('index.php'));
@esedic
esedic / git-merge.txt
Created Aug 22, 2019
Git merge message
View git-merge.txt
Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
press "i"
write your merge message after #
press "esc"
write ":wq"
then press enter
You can’t perform that action at this time.