Skip to content

Instantly share code, notes, and snippets.

🔥
In case of fire: git commit, git push, leave the building!

Dalibor Gogic daliborgogic

🔥
In case of fire: git commit, git push, leave the building!
Block or report user

Report or block daliborgogic

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
View img_crop_to_file.php
<?php
$imgUrl = $_POST['imgUrl'];
$imgInitW = $_POST['imgInitW'];
$imgInitH = $_POST['imgInitH'];
$imgW = $_POST['imgW'];
$imgH = $_POST['imgH'];
$imgY1 = $_POST['imgY1'];
$imgX1 = $_POST['imgX1'];
$cropW = $_POST['cropW'];
$cropH = $_POST['cropH'];
View gist:17b6bb5259a430e55253
<title></title>
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<meta http-equiv="cleartype" content="on">
@daliborgogic
daliborgogic / gist:c1cce5e0e1b0da029657
Created Jul 10, 2014
checking image size before upload
View gist:c1cce5e0e1b0da029657
var x = document.getElementById('APP_LOGO'); // get the file input element in your form
var f = x.files.item(0); // get only the first file from the list of files
var filesize = f.size;
alert("the size of the image is : "+filesize+" bytes");
var i = new Image();
var reader = new FileReader();
reader.readAsDataURL(f);
i.src=reader.result;
var imageWidth = i.width;
@daliborgogic
daliborgogic / width.php
Last active Aug 29, 2015
php screen resolution
View width.php
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<meta http-equiv="cleartype" content="on">
View header.php
<!-- nav -->
<nav class="nav visualyHidden" role="navigation">
<div class="w700 clear">
<img class="showNav second" src="<?php echo get_template_directory_uri(); ?>/img/logo.svg" onerror="this.src='<?php echo get_template_directory_uri(); ?>/img/logo.png'; this.onerror=null;" width="40" height="40" alt="">
</div>
<?php //html5blank_nav(); ?>
<ul>
<li><a href="<?php echo home_url(); ?>"><?php the_field('anchor_home'); ?></a></li>
<li><a href="#<?php echo str_replace(' ','-', strtolower(get_field('anchor_about'))); ?>"><?php the_field('anchor_about'); ?></a></li>
View .eslintrc
{
"env": {
"node": true
},
"rules": {
// Rules are divided into sections from http://eslint.org/docs/rules/
// Possible errors
"no-cond-assign": 0, // regex matching is easier with statements in loop contitions
View editorconfig#foo.txt
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@daliborgogic
daliborgogic / project_folder.md
Last active Aug 29, 2015
Setting up a Project Folder, Document Naming Convention & Project Folder Structure
View project_folder.md

Introduction

This document can be used as a guide to help organize your project folder and to provide an example on document naming conventions. It will also explain how to set up a project folder on for your project documentation. While planning any project, it is up to the project team on where documents go within each folder and the choice of document naming conventions, because every project is unique. The objective of providing a guide is to provide the following within each project:

  • Familiarity: Reduces the learning for people who move between projects. If they are familiar with a common structure, it is easier to file new things, and find old things.
View gist:52d23a285b9a1043ad50
<?php
$headerImageDesktop = get_field('header_image_desktop', 'option');
$headerImageTablet = get_field('header_image_tablet', 'option');
$headerImageMobile = get_field('header_image_mobile', 'option');
if ( $headerImageDesktop && $headerImageTablet && $headerImageMobile ): ?>
<div class="headerConatiner">
<div class="headerImage">
View gist:0337d4faf3aa47dbc169
Browser Support
At present, we officially aim to support the following browsers:
IE9, IE10, IE11, IE Mobile 10
FF 30, 31
Chrome 34, 35
Safari 7, 8
Opera 23, 24
iOS Safari 7, 8
You can’t perform that action at this time.