Skip to content

Instantly share code, notes, and snippets.

View daliborgogic's full-sized avatar
:octocat:
In Git we trust!

Dalibor Gogic daliborgogic

:octocat:
In Git we trust!
View GitHub Profile
<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 July 10, 2014 14:35
checking image size before upload
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 August 29, 2015 14:03
php screen resolution
<!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">
<!-- 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>
@daliborgogic
daliborgogic / .eslintrc
Created January 2, 2015 12:38
.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
@daliborgogic
daliborgogic / editorconfig#foo.txt
Last active April 18, 2016 08:32
editorconfig
# 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 August 29, 2015 14:14
Setting up a Project Folder, Document Naming Convention & Project Folder Structure

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.
<?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">
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
{
"hex":"#BE2E22",
"websafe":"#cc3333",
"rgb":{
"r":190,
"g":46,
"b":34
},
"hsl":{
"h":5,