To change the hostname of a machine you can use the following command: “hostname mynewhostname”. - With out the quotes. Worth noting is this does not affect the DNS and this is only for the current session. By rebooting the server, this information will reset to whatever Amazon machine is configured to.
Say for instance that you want to open the file select dialogue for a user to select an file to upload. Like a photo, pdf or any other file type. However, you don’t want to use the standard file input HTML element, instead use a styled link or button to show the file window.
GIT is an excellent version control system with its GUI GIT Extensions. Something I was thinking about was finding a way to push only the project file changes to the live server. Ideally being able to choose a committed version to push live, or roll back too. There are ways like bundling the project into a .zip or .tar file and deploying it.
Recently found a extremely simple way to fix a problem in one of our projects at work in MySQL stored procedures. Hopefully saving everyone else the massive amount of time spent adapting the program to work.
If you have recently upgraded to the new iOS 5 and opted to use the iCloud you might have noticed that you can no longer add or edit your contacts. If you are one of these people the fix is quite simple but some what annoying.
After installing the latest firmware version 3.70 for the PlayStation 3 I noticed that the TV option had disappeared. How the hell did that happen?! This of course means that I could not access the BBC iPlayer via the icon, not like it was an issue just annoying, since it was basically loading it in the browser. I don’t know if anyone has tried using the new version of the BBC iPlayer in the_ PlayStation browser_, it kind of doesn’t work. You can navigate using the D-Pad but you can’t actually click through to the actual video item. The essential bit! Then I thought I will just search for the item using Google, found the TV series clicked on it and was faced with a loading screen that did not load anything! I gave it two minutes more that enough time. Great can’t access that actual videos directly, this is unbelievably frustrating, I was about to explode!
This is carrying on from a previous post Twitter Feed using JQuery JSON. Originally, I just used JQuery JSON method to query the Twitter API which got essential bits of a user profile and their time line. It only returned the latest ten results which is sufficient enough with the nature of twitter, tweets get old quick but some are worth checking again. With the Twitter API there is no guarantee to get the exact amount of tweets you requested. What is new in this revised edition of the twitter feed is it will now take the tweets and save a local version of it. This has plenty of benefits like quicker response when querying, view older posts, improved usability and you can customise the output how ever you like. Here is a list of what is new:
I found myself needing to run a script to make minor adjustments to the page based on the size of an image, to keep things tidy. The problem I was having was using JQuery’s $(document).ready the script was executing as soon as the DOM was ready which is too early. The other option is to use $(window).load which runs only when the whole page has loaded, guaranteeing that I will get the image width and I can make my adjustments. The script below is used to make the image caption the same width as the image.
The Twitter API allows you to access tweets, profile information and more. It has a couple of return types of data, I will be using the JSON format. If you are accessing the tweets that belong to a profile you don’t need authentication unless they are protected. In the documentation it will tell you if authentication is required to access certain data.
Here is something that I recently found very useful. If you have a table in your MySQL database which you want to insert a record if it does not exist but update the row if it does. MySQL 5.x has a very neat piece of script to handle this with out any conditional statements.