code Archives - Daniel Meola https://dmeola.com/category/code/ Blog of a Webmaster Tue, 13 Nov 2018 22:07:06 +0000 en-US hourly 1 Learning Python https://dmeola.com/python/ https://dmeola.com/python/#respond Thu, 08 Mar 2018 13:28:35 +0000 http://www.dmeola.com/?p=60 Programming skills at any level are an invaluable resource in any field. The sooner you pick up programming skills the sooner you will start finding and fixing inefficiencies in your daily processes. You do not need to have a programming background to begin, and you …

Learning Python Read More »

The post Learning Python appeared first on Daniel Meola.

]]>
Programming skills at any level are an invaluable resource in any field. The sooner you pick up programming skills the sooner you will start finding and fixing inefficiencies in your daily processes. You do not need to have a programming background to begin, and you do not need to be a pro to reap the benefits.

Python is my favorite programming language because it has a low barrier to entry, shallow learning curve, and multitude of practical applications. If you have a Mac python is already installed on your operating system and you can begin just by open up the terminal application and typing python at the command prompt. Some practical applications of python include but are not limited to:

  • task automation
  • web development
    • Requests
    • Beautiful Soup
    • Paramiko
    • Flask
    • Django
  • software development
    • Odoo
    • Tryton
    • wxWidgets
  • science + math, machine learning
    • SciPy
    • Pandas
  • education

Whether you are just getting into programming for the first time or are an experienced developer python will be an invaluable tool for you. If you’re wondering how python could help you, start with Automate the Boring Stuff and start accelerating your productivity today.

The post Learning Python appeared first on Daniel Meola.

]]>
https://dmeola.com/python/feed/ 0
Subtle Patterns https://dmeola.com/subtle-patterns/ https://dmeola.com/subtle-patterns/#respond Thu, 08 Mar 2018 02:24:17 +0000 http://www.dmeola.com/?p=37 I often get stuck at the point where I need to choose a background for my site. It requires a balance between attractiveness and subdued nature that adds to the overall effect of your page’s design without distracting from its contents. Enter subtle patterns, a site …

Subtle Patterns Read More »

The post Subtle Patterns appeared first on Daniel Meola.

]]>
I often get stuck at the point where I need to choose a background for my site. It requires a balance between attractiveness and subdued nature that adds to the overall effect of your page’s design without distracting from its contents. Enter subtle patterns, a site dedicated to lightweight patterns that you can easily review add to your site.

The post Subtle Patterns appeared first on Daniel Meola.

]]>
https://dmeola.com/subtle-patterns/feed/ 0
placehold.it https://dmeola.com/placehold-it/ https://dmeola.com/placehold-it/#respond Thu, 08 Mar 2018 02:18:24 +0000 http://www.dmeola.com/?p=31 A shift towards responsive web design requires more than acquiring new coding skills. Organizational changes may be in order, including a shift towards agile development, and a blurring of the lines between design and code. To best facilitate the prototyping of a responsive design the …

placehold.it Read More »

The post placehold.it appeared first on Daniel Meola.

]]>
A shift towards responsive web design requires more than acquiring new coding skills. Organizational changes may be in order, including a shift towards agile development, and a blurring of the lines between design and code. To best facilitate the prototyping of a responsive design the developer and designer should be sitting down together and creating comps using a browser rather than Photoshop. It is difficult to consider all of the implications of the different breakpoints without a working model. Insisting upon pixel perfect implementation is no longer a reasonable expectation, but frequent tweaks are inevitable.

A great tool for use in rapid prototype development is placehold.it, which can dynamically create images on the fly using the URL query string. While creating your model, you may want to see what the design looks like with a 960x400px hero image, only to determine 960x300px would look much better. Instead of creating mock assets in photoshop, or putting a border on a div and treating it like an image consider placehold.it.

Placeholdit allows you to generate images on the fly. Want an image 350x150px? Set your background image url (or img src) to http://placehold.it/350×150.

There are also options to change the background color and the text overlay.

<img src=”http://placehold.it/350×150/333333/fff&text=nifty!”>

Tips: the first color represents the background (333333), and the second represents the text color (fff). Everything is optional except size, which always comes first. Specifying only one dimension will create a square.

The post placehold.it appeared first on Daniel Meola.

]]>
https://dmeola.com/placehold-it/feed/ 0
SpriteCow https://dmeola.com/spritecow/ https://dmeola.com/spritecow/#respond Thu, 08 Mar 2018 02:16:24 +0000 http://www.dmeola.com/?p=28 Reducing HTTP requests during your site’s page load is key to improving performance. By combining multiple images into a single sprite, you are loading all of those images onto the client’s browser in a single request. If you are already on HTTP2 you can disregard …

SpriteCow Read More »

The post SpriteCow appeared first on Daniel Meola.

]]>
Reducing HTTP requests during your site’s page load is key to improving performance. By combining multiple images into a single sprite, you are loading all of those images onto the client’s browser in a single request. If you are already on HTTP2 you can disregard this performance tip. For the rest of you, read on!

The trick is then to use css to display the appropriate image within that sprite. This is typically done by setting the sprite as the background image, along with a width and height. The key is then to find the offset of the image you want, which can be difficult even with Photoshop, particularly when the image is not rectangular. As a result, sprites are often not utilized because of the extra effort needed to position each background image.

SpriteCow allows you to upload your sprite, and select images within the sprite for which you need positions and sizes. It will automatically select the boundaries of the image you click, or allow you to select a group of images (useful for separate letters in a word). It then gives you sample css:

.sprite {
background: url('imgs/example.png') no-repeat -433px -51px;
width: 33px;
height: 33px;
}

The post SpriteCow appeared first on Daniel Meola.

]]>
https://dmeola.com/spritecow/feed/ 0
jQuery https://dmeola.com/jquery/ https://dmeola.com/jquery/#respond Thu, 08 Mar 2018 02:07:51 +0000 http://www.dmeola.com/?p=21 Javascript is a great tool for adding life to a site, is compatible with all standard web browsers, but it can take a while to develop javascript from scratch. Fortunately there is a lightweight and feature rich javascript library that makes document traversal, event handling, …

jQuery Read More »

The post jQuery appeared first on Daniel Meola.

]]>
Javascript is a great tool for adding life to a site, is compatible with all standard web browsers, but it can take a while to develop javascript from scratch. Fortunately there is a lightweight and feature rich javascript library that makes document traversal, event handling, and animation much simpler. You can quickly skim through the extensive jQuery documentation to get a feel for its capabilities, then begin coding. You’ll fall in love with selectors if you’ve ever struggled to locate an element in the HTML DOM, but you’ll stay for the UI widgets and interactions. You’ll save time writing and maintaining your jQuery scripts, and you just might get carried away improving the user experience across your site.

The post jQuery appeared first on Daniel Meola.

]]>
https://dmeola.com/jquery/feed/ 0
Bootstrap https://dmeola.com/bootstrap/ https://dmeola.com/bootstrap/#respond Thu, 08 Mar 2018 01:42:02 +0000 http://www.dmeola.com/?p=8 Overview When you are prototyping an idea or time to market is your top priority Bootstrap is an invaluable tool. It provides a CSS framework and some javascript tools which allows you to quickly build and attractive site without much thought to the UI. It …

Bootstrap Read More »

The post Bootstrap appeared first on Daniel Meola.

]]>
Overview

When you are prototyping an idea or time to market is your top priority Bootstrap is an invaluable tool. It provides a CSS framework and some javascript tools which allows you to quickly build and attractive site without much thought to the UI. It takes some upfront investment in time to get familiar with the provided components but it pays off over time as you find yourself able to build sites in minutes. I’d recommend skimming through the documentation to familiarize yourself with the available features so that you can dive deeper when you find a need.

Responsive design is built in, and you’ll find common elements look great out of the box- forms, button, dropdowns, tables, modals, and more are built in.

 

The post Bootstrap appeared first on Daniel Meola.

]]>
https://dmeola.com/bootstrap/feed/ 0