Posts tagged #web development:
Show History of Changes to Specific File with Git
I am always having to google this to find the correct command.
I often need to see a history of changes to a specific file.
The best command I have found for this so far is:
git log -p [filename]
Git Diff Show Changes on Branch Only
git diff master...feature
That shows only new changes on feature with respect to master.
How do I pull a native DOM element from a jQuery object?
Ruthless plagiarised from the jQuery website
A jQuery object is an array-like wrapper around one or more DOM elements. To get a reference to the actual DOM elements (instead of the jQuery object), you have two options. The first (and
Magento 1 Rest Api Multiple SKU Query
It took me a long time to track down this solution to get multiple products by SKU out of the Magento Rest API... But here's the solution I've found:
Find Magento Layout Handle for Current Controller/Action
I is still getting the hang of the whole Magento layout functionality but have just found a couple of tips that have helped me greatly.
As I understand it the layout handle of and xml file is the node that is called when a particular…
Magento block caching
If you set it to false, Zend cache will get default value of 7200 seconds!! If you want infinite never expired cache set it to 9999999999, which is Zend_Cache maximum value, or something else big enough.
Magento block caching • Inchoo
Loving this tweet...
Web making: 1. Identify core functionality. 2. Make that functionality available using the simplest technology. 3. Enhance! @adactio #aeabos— Jeffrey Zeldman (@zeldman) May 17, 2016
Web Dev Axioms to Live By
Loving this tweet...
web dev axioms to live by: #1 if you can do it in HTML, don’t use CSS#2 if you can do it in CSS, don’t use JS#3 if all else fails use JS— John Allsopp (@johnallsopp) April 12, 2016
Load A Joomla! Template File From A Separate View
I am working hard to improve the quality of my php code and one of significant technique is to use the DRY principle.
However this can become a little harder to stick to when using a framework / CMS. I mostly work with…
2 Hard Things in Computer Science
I've long been a fan of this quote from Phil Karlton
"There are only two hard things in Computer Science: cache invalidation and naming things"
However I am an even bigger fan of the slight variation on it:
"There are only two hard things in Computer Science: cache
Git --assume-unchanged Problem When Switching Branches
I had a problem switching to a different branch when using git --assume-unchanged. I've been using this command as a lazy git ignore and found it quite useful.
However, I recently tried to switch a branch when I had marked a config file --assume-unchanged and had…
Search a Multi-Dimensional PHP Array with Standard PHP Library Recursive Iterator
(That's definitely the best blog post title I've ever come up with...)
Messing with php arrays often messes with my head...
So I needed to search a multi-dimensional array and return the results in an easily accessible format.
A bit of research uncovered…
Super Simple Git Submodule Guide
Hopefully you already have some idea what a git submodule is, but if not:
It often happens that while working on one project, you need to use another project from within it. Perhaps it’s a library that a third party developed or that you’re developing separately and…
PHP DateTime Class - Or why it pays to read the documentation (sometimes!)
I've always struggled with dates in PHP, more specifically writing dates submitted by a PHP form to a database correctly formatted.
I've done a few weird and wacky things to get the dates into the database as proper datetime…
Joomla! Styleguide Component
Website Styleguides are very 'de rigueur' at the moment. I work with Joomla! a lot and felt that a Styleguide component could be useful.
These website styleguides are often also called Pattern Libraries.
I think they can be very useful!
My component is currently available on Github
I have worked with Joomla! for a number of years and whilst in many ways it is an excellent content management system, it does still suffer from a common problem. A lot of CMSs get very bloated with extra (sometimes) unnessary code.…
Great Gif: Refactoring
Love this gif!
A Couple of Tips for Using PHP at the Command Line
On vary rare occasion I find it useful to run php in the command line.
There are a couple of easy ways to do this, but the first thing you might want to do is check your php version.
This is easily…
Super Read -> More Weight Doesn't Mean More Wait
Formerly, much of the focus in web performance was concerned with optimizing assets like images and fonts, which does make for a shorter overall page load time. But today there are techniques we can use in addition to file optimization that have…
Awesomplete by Lea Verou
Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers. Because still doesn’t cut it.
Awesomplete: Ultra lightweight, highly customizable, simple autocomplete, by Lea Verou
This looks like a great little bit of code... Planning to use it somewhere soon!
The Problem With Websites
Saw this great tweet the other day and thought I'd pop it here for posterity.
The problem with websites. pic.twitter.com/cTkSKy4pKF
— Erwänn Mest (@_kud) March 10, 2015
What is Scrum? An Agile Framework for Completing Complex Projects - Scrum Alliance
The Scrum framework in 30 seconds:
A product owner creates a prioritized wish list called a product backlog.
During sprint planning, the team pulls a small chunk from the top of that wish list, a sprint backlog, and decides how…
JCH Optimize Joomla Plugin for Non-Logged in Users
I have recently found a fantastic Joomla plugin that addresses a number of issues I was having with Joomla.
Click here to Cut to the chase
The JCH Optimize can:
How to transition height auto in CSS3
The short answer – you can’t..!
It is not possible to transition height zero to auto.
transition:height 2s ease;
…will not work… Despite the fact that this seems like a fairly natural thing to want to do.
However there is a trick to simulate this behaviour.…
Count number of words in text using MySQL
I was trying to count the number of words in some MySQL results today.
This is easy enough with PHP using str_word_count
However there is no simple command to do it in MySQL
However I found this great post that give a nifty little trick for
Open all Changed and Unstaged Files from Git in Vim
vim $(git ls-files --others --exclude-standard && git diff --name-only)
Open all files from a specific Git Commit in Vim
I occasionally find myself needing to open all files from a specific Git commit. I use vim as my editor.
I created a little alias to get all the names of files modified in the specific commit and open them all in
Go to last file and last cursor location in Vim
Open Vim and press Ctrl+o+o
It will take you directly to your last opened file and last cursor location.
Open Vim and press Ctrl+o+o It will take you directly to your last opened file and last location of the cursor.https://t.co/0HvURMTh1N— Mastering