I not actually using this in a project (but I'm going to soon) but this library allows you to dynamically add a badge to your site's favicon.
I love how convenient PuPHPet makes creating and maintaining your website's VMs but I hate how it adds two additional folders and three additional files to the root of our project.
It turns out there is a quick solution to this problem.
Create a new folder named Vagrantfiles
and copy every file except the Vagrantfile
into this folder. Then find this section of your Vagrantfile
:
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.module_path = "modules"
puppet.options = ['--verbose']
end
and change it to:
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "Vagrantfiles/manifests"
puppet.module_path = "Vagrantfiles/modules"
puppet.options = ['--verbose']
end
Now it's much cleaner so I can dump all the files I need for my project there. :-)
I just finished reading Masters of Doom: How Two Guys Created an Empire and Transformed Pop Culture and I couldn't put it down. It focus on the lives of John Carmack and John Romero and how they created id software and what it did to the world. Parts of it read like a biography and parts of it read like a crazy drama where nobody can get along. I won't ruin it for you but I'm surprised that id is still a company after reading this book.
I needed a quick way to verify that the date the user was entering into an input box was a valid date in a calendar (not 14/50/2013). I created the following function to do so. It only works with mm/dd/yyyy and yyyy-mm-dd but it's easy enough to extend for others.
function isValidDate(date){
var year = 0;
var month = 0;
var day = 0;
var match = date.match(/(\d{2})\/(\d{2})\/(\d{4})/);
if(match != null){
month = match[1];
day = match[2];
year = match[3];
}
var match = date.match(/(\d{4})-(\d{2})-(\d{2})/);
if(match != null){
year = match[1];
month = match[2];
day = match[3];
}
month -= 1;
var testDate= new Date(year,month,day,0,0,0,0);
if (testDate.getFullYear() != year){
return false;
}
if(testDate.getMonth() != month){
return false;
}
if(testDate.getDate() != day){
return false;
}
return true;
}
This is a very dense article but it has a lot of little nuggets of information for someone like me who self taught themselves SQL as the needed it.
I think this is the part that was super helpful to me:
SELECT is executed after most other clauses. Most importantly, after FROM and GROUP BY. This is important to understand when you think you can reference stuff that you declare in the SELECT clause from the WHERE clause.
This causes me to have problems like this (their code sample):
SELECT A.x + A.y AS z
FROM A
WHERE z = 10 -- z is not available here!
http://tech.pro/tutorial/1555/10-easy-steps-to-a-complete-understanding-of-sql via Reddit?
When I work on client work I usually have to branches the master
branch that always contains the current state of the site on their server and a devel
branch that contains new code. This way I can quickly switch between working code and devel code.
Normally, I do this using the following commands:
git checkout master
git checkout devel
git checkout master
But that's a lot extra typing because it turns out there there is a quicker way to do this.
git checkout -
I'm so happy this isn't actually how pair programming works.
[embed]http://www.youtube.com/watch?v=dYBjVTMUQY0[/embed]
via Reddit
I'm not sure if this is the most awesome thing or the dumbest thing I've ever seen but I wish there was some way I could hide it in a project.
Are you having a hard time finding local cats in your area? Do you wish there was a way to connect instantly with one online, at any time? Now you can!
With Adult Cat Finder, you're never more than one click away from chatting with a hot, local cat in your area!
A quick read on how git stores it's data. The part I found interesting was that git stores whole copies of the files you create when they're committed and then calculates the diffs on the fly. It also talks about the git repack
command which I didn't know existed and I will have to experiment with soon on a non-critical repo.
This is an interesting article that goes over the various techniques used by Free to Play (F2P) games. I think F2P and freemium are the future of gaming and in a lot of cases web sites.
http://www.gamasutra.com/blogs/RaminShokrizade/20130626/194933/The_Top_F2P_Monetization_Tricks.php
subscribe via RSS