iOS AND ANDROID
Topics:
Choose a taghttp://ami.responsivedesign.is/
This was shared by a collegue of mine, Justin. The concept for this site is simple, but extremely useful. If you need to take screenshots of a website on various devices, but don’t want to go through all the devices manually, this site is your answer. Basically the way it works, the site has an iframe for each of the device resolutions. Since the mockups of the devices on the homepage overlap, you can click on each device and bring it to the forefront if you need to. You can also grab each device on the site and move them around. Pretty cool and simple site that helps save a lot of time.
This came from a conversation that I had with our curation team about content marketing strategy and how to do it right. We have a considerable amount of experience in learning from our clients as well as our own faux pas in marketing. Learning from from the past, we’ve realized that there are two main components of content marketing: developing content on a consistent basis and developing the distribution method for the content. Too many times managers fall into the trap of working on the distribution methods before working on the content creation strategy.
Content is having good useful, relevant, and important things to say for each of the different audiences that your company is trying to reach. It’s also not a 1-time thing, it’s an ongoing flow or cadence of content that you will have to create and put out there. Distribution methods (or whatever you want to call it) are the various channels in which you distribute the content: websites, blogs, marketing materials, newsletters, social media, the list goes on.

In content marketing, you must first figure out how you are going to create content for your audiences over and over again. There are multiple ways to do this, which is probably another post at another time. Nonetheless, you must do this planning before launching the distribution methods. Too many times companies setup blogs and social sites, without having a steady flow of content to fill it. This just looks unprofessional and unplanned (present company included).
So the next time someone whats to talk to you about setting up a blog, Twitter, or Facebook page, ask about or think about how you will create an ongoing stream of content that will be useful and relevant for your audiences. Otherwise, be ready to play catch up or explain to someone why your last blog post was from 2009.
Thank you, let me know what you think or are interested in hearing more about how we do it in the comments below.
This site has been in my toolbox for quite a while now and still comes in handy when I can’t automate the compression of JS files. You can either copy and paste the JS or upload the whole file and get back the minified JS. It’s amazing to be able to reduce a file’s size by 70% to 80% and still have it work as intended.
If you need reasons for minifying a JS file, here you go:
Wanted to share one of the websites I end up using a lot due to my inability to remember every htaccess command from memory. here’s a list of the commands documented there:
Detect and redirect iPhone
How to create a password for a .htpasswd file using PHP
How to find the full path to a file using PHP
Htaccess redirect
htpasswd – The file to store passwords
Prevent hotlinking
Redirection
Password Protection with htaccess
Hope you find it as useful as I do!
For a recent project, we had a request to make an existing variable within certain links dynamically change depending on a variable in the current URL. To achieve this, there are two key scripts that are available. First you need to extend jQuery to be able to grab the URL variable. Add the following code in your javascript file, outside of the document.ready:
$.extend({
getUrlVars: function () {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function (name) {
return $.getUrlVars()[name];
}
});
Now, you are ready to grab any variable from the URL using $.getUrlVar();
Let’s say you wanted to grab the parameter of the URL http://www.localwisdom.com?code=Awesome. To return “Awesome,” from the code variable add this definition inside your document.ready:
var getURL = $.getUrlVar('code');
That’s the first part of the script that you will need. Pretty easy, right? I have two options for the second part of the script. The first is to add variables that do not yet exist on current links. We’ll work with a basic button here:
<a class="button" href="http://www.woobleattack.com">Wooble Attack</a>
We want to add the variable app to this button and give it the value returned from getUrl.
$('a.button').each(function(){
$(this).attr('href', function() {
return this.href + '?app='+getURL;
});
});
This will change your button’s link to http://www.woobleattack.com?app=Awesome
If your button already has the variable app defined and you wanted to swap out what was already there, just use this code instead of the above mentioned one:
$('a.button').each(function(){
$(this).attr('href', function(i,a){
return a.replace(/&?app=([^&]$|[^&]*)/i, '&app='+getURL);
});
});
This will wipe out the existing variable definition and create a new one.
R
ecently I’ve been doing a lot of web programming and it was only a matter of time before I needed to use a MySQL database. I found this really useful tool for PHP called Mysqli. There’s a whole lot on the advanced use for Mysqli on the link I just provided, but I’m going to give you a quick example that you will be able to follow for a good majority of your queries.
$mysqli = getDatabase();
//call performResultQuery() and performUpdateQuery() here..
$mysqli->close();
//========= Functions ============
//For getting data from database
function performResultQuery($resultQuery){
global $mysqli;
//You might want to return result if you're
//Performing multiple queries
$result = $mysqli->query($resultQuery);
$row = $result->fetch_row();
$firstVal = $row[0]; //Grabs first column in row
$secondVal = $row[1]; //Grabs the second column in row
//etc...
}
//For updating data in database
function performUpdateQuery($updateQuery){
global $mysqli;
$mysqli->query($updateQuery);
}
//Return the database, fill in DB_HOST, DB_USER
//USER_PASS, and DB_NAME
function getDatabase(){
$DB_HOST = '';
$DB_USER = '';
$USER_PASS = '';
$DB_NAME = '';
$DB_CONNECTION = new mysqli($DB_HOST, $DB_USER, $USER_PASS, $DB_NAME);
// Checking connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
return $DB_CONNECTION;
}
Mysqli has been the only MySQL connection I’ve used in PHP, but am so pleased with it I find no need to search for an alternative.

Working on a project in phonegap and had to figure out how to stop the auto correct feature of IOS from affecting certain types of HTML input fields that really didn’t need auto-correction such as “First Name”.
Stackoverflow came through again in this post: http://stackoverflow.com/questions/6461101/how-can-i-prevent-keyboard-autocompletion-in-mobilesafari-uiwebview
All I had to do is put autocorrect=”off” in the element to stop the auto correct. Thanks to Patrick for finding this!
<input type="text" id="your-field" autocorrect="off" />

So the other day I was having a touch time trying to figure out why this query wasn’t working for a client project of mine. I started out my career programming on the SQL side of things, so my SQL skills are much higher than my LINQ skills. After a while of trying to figure out what was wrong with this query, I wanted to view the SQL that was being generated by the LINQ query. So off to google and once again stack overflow comes through again: http://stackoverflow.com/questions/1412863/how-do-i-view-the-sql-generated-by-the-entity-framework
var result = from x in appEntities
where x.id = 1
select x;
var sql = ((System.Data.Objects.ObjectQuery)result).ToTraceString();
The .ToTraceString() was able to show me the query and allowed me to figure out that the query wasn’t the problem. According to the 2nd most popular response, using it in the watch window will also pull it out for you.
At Local Wisdom, we’ve been a Subversion shop for a while, but it seems like all the cool kids are using Git now. From my understanding there’s a few reasons to move from SVN to Git and some of the big ones are:
1. It’s distributed. You don’t need to be connected online to work on code a make commits. When you want to “commit” to the server that everyone else on your team can pull from, you do a “push”
2. The branching and merging is much better and results in less conflicts.
3. Much faster to complete branching and merging since it all happens locally.
Speaking for myself, I’ve never had an issue with 1 and 3, but number 2 is definitely something I find annoying with SVN. I’ve had changes occur on 2 functions that are near each other, but not the same function and a conflict arises. It also seems the further out you are from the last time you’ve merged, the more likely a conflict will happen (but that does make sense). Anyway, we’re going to try Git for 1 particular internal project to see if it’s that much better at branching and merging than SVN. Installing for Windows isn’t too bad once you’ve found a good run through like they have on beanstalkapp.com.
So here’s my summary of how to install Git on Windows for my collegues at LW which is derived from the beanstalkapp.com guide.
Download mysysGit from: http://msysgit.github.com/
Direct link to the files themselves:
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
Accept the default options until you get to this screen and choose “Run Git from the Windows Command Prompt”
On this screen, leave default of “Checkout Windows-style, commit Unix-style line endings”
Now we need to setup the SSH key to communicate with the Git server that holds the master Repo. We’re going to be using OpenSSH to create our keys which was installed with our Git installation. Right click on desktop and choose Git Bash:
At the prompt type in:
ssh-keygen -t rsa
It will ask for location (leave at default: C:\Users\username\.ssh) and pass phrase (you can leave blank or put one in. If you put in, you’ll need to put in every time you connect to the main Git server).
The keys are now generated and you can open up the file , open the file C:\Users\username\.ssh\id_rsa.pub with a notepad. This file is your public key and you’ll want to copy it to your Beanstalk profile (under the Profile and Settings >> Keys >> Add Public Key).
Your SSH public key should look something like this:
Now let’s check if the connection to the remote repository works. Run Git Bash, and enter this command:
ssh git@accountname.gitproviderdomain.com
When authenticating or later when trying to connect to Git repository most likely you will encounter a message that looks like this:
The authenticity of host 'accountname.gitproviderdomain.com
(xxx.xxx.xxx.xxx)' can't be established. RSA key fingerprint
is xx:yy:zz:xx:yy:zz:xx:yy:zz.
Are you sure you want to continue connecting (yes/no)?
You can type “yes” and press Enter. If it works, this is the type of message you’ll see:
You were successfully authenticated as [email] in
accountname.gitproviderdomain.com.
Now install TortoiseGit: http://code.google.com/p/tortoisegit/
Make sure to select OpenSSH
When done, Right click on desktop >> TortoiseGit >> Settings
And put in the basic settings used for your Git Repo like Name and Email:
Now lets pull the Repo down locally, use Git Clone:
And finally fill in the Repo URL to pull from (if you did set a Pass Phrase earlier for your SSH keys, you’ll need to enter it when prompted) and where you want to Repo to reside locally:
That should do it, hope you found this helpful and I’ll write a follow up piece after we’ve been using Git for a while to let you know if all this setup was worth it and if Git was better then SVN.
Had an issue today working with .Net framework 2.0 and adding some new languages. Good ole Google to the rescue, our new languages aren’t supported by 2.0, so finally a reason to fully upgrade to 4.0 for this older site.
http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28v=vs.80%29.aspx
Hope you find it helpful