This so often feels exactly like what I do … except the big bucks part …
From CommitStrip.
A big part of my work has to do with code. I’ve worked as system administrator – installing, patching, and configuring someone else’s code. I’ve worked as independent programmer, writing code on my own. I also programmed as part of the team. And on top of that, I worked as Team Leader and Project Manager, where I had to interact a lot with programmers. Programming world on its own is as huge as the universe. There is always something to learn. When I find something worthy or something that I understand enough to write about, I share it in this category.
Here’s something that came in helpful the other day at work – “Simple file upload using jQuery and AJAX“. We were on the right track, but this blog post helped iron out the last few details. In particular, this bit:
$.ajax({ url: 'submit.php?files', type: 'POST', data: data, cache: false, dataType: 'json', processData: false, // Don't process the files contentType: false, // Set content type to false as jQuery will tell the server its a query string request success: function(data, textStatus, jqXHR) { if(typeof data.error === 'undefined') { // Success so call function to process the form submitForm(event, data); } else { // Handle errors here console.log('ERRORS: ' + data.error); } }, error: function(jqXHR, textStatus, errorThrown) { // Handle errors here console.log('ERRORS: ' + textStatus); // STOP LOADING SPINNER } });
And a clarification of the parameters:
2 attributes need to be set to false:
- processData – Because jQuery will convert the files arrays into strings and the server can’t pick it up.
- contentType – Set this to false because jQuery defaults to
application/x-www-form-urlencoded
and doesn’t send the files. Also setting it tomultipart/form-data
doesn’t seem to work either.
There’s a GitHub repository with all the necessary example code.
Don’t ask me how, but I’ve ended up in the Google Chrome Web Store, where I spent the last three hours – especially in the Productivity -> Developer Tools category. I knew, there were plenty of apps to make Chrome OS / Chrome Browser super awesome, but it seems it’s been a while since I looked in there … My mind is officially blown!
I don’t need much from my Fedora laptop – a browser, a terminal, and some instant messaging apps. But these days apparently that’s too much. A lot of the things I do through the regular day can be handled right from the browser apps.
Here are some examples.
Most of these offer session saving, networking synchronization, Google Drive data saving, social network integration, etc.
Wow! The browser world has come a long way since Netscape 3 …
I came across the WWW SQL Designer today, and I have only one thing to say…
Holy Molly! I’ve been looking for a tool like this for a long long time! It is a web-based database designer, which can export designs into MySQL. It’s super easy to use and it does exactly what it is supposed to. No non-sense. Simply amazing!
Git is an excellent version control, but it’s more than just that. A lot of people use it to deploy their projects as well. Most suggestions (for example, this tutorial from Digital Ocean) around the web employ the post-commit (or other) hooks to push the code to a remote server. While this works well, I prefer to do it differently. I like the pull model better, where the deployment is triggered outside of git, and relies on git to fetch the code updates and run some sort of a build script, which handles database schema changes, cache resets, filesystem permissions, etc. Such approach also allows to limit remote access to the servers (especially the production ones), and separate responsibilities of a developer and a deployer.
With the many pull, merge, fetch, and update options that git provides, it is sometimes difficult to choose what’s the right set of commands to use. I’ve figured it out via a rather lengthy trial-and-error process. But if you don’t want to go through all the pain of that, here’s a nice blog post that tells you exactly how to do that. I’m copy-pasting the commands here just for the future reference.
cd "${DEPLOY_TREE}" git fetch --all git checkout --force "${TARGET}" # Following two lines only required if you use submodules git submodule sync git submodule update --init --recursive # Follow with actual deployment steps (run fabric/capistrano/make/etc)
And I suggest you read the full article for the explanation of why this is a better way and what are some of the issues with other strategies.