Skip to content

Instantly share code, notes, and snippets.

View jasondavis's full-sized avatar

Jason Davis jasondavis

View GitHub Profile
@jasondavis
jasondavis / dabblet.css
Created November 20, 2012 19:11
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
#wrapper {margin: 0 auto -46px;height: 100%;
min-height: 100%;
background: #F3F3F3 fixed no-repeat url(http://www.stickermule.com/images/dribbble/bg.jpg);background-position: 0px 260px;background-size: 100% auto;
}

I finally got the time to play around with unit testing in PHP. I've heard about the term months ago but I really never had the time to play around with it because I considered it as not absolutely necessary for my development workflow. I mean I can still produce useable programs without writing a test for it right?

But admit it, testing the program that you have written is not really that exciting as writing the program itself. Sometimes we even get lazy and not test the program at all only to find things breaking on production. (Note: I'm referring to in-browser testing here)

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
---
layout: post
title: "Playing with Unit Testing in PHP"
date: 2012-12-05 19:14
comments: true
categories:
published: true
---
I finally got the time to play around with unit testing in PHP.
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
var iTunes = (function() {
var endpoint = 'http://itunes.apple.com/search',
searchOptions = {
term: '',
country: 'US',
media: '',
entity: '',
attribute: '',
callback: 'iTunes.end',
@jasondavis
jasondavis / dabblet.css
Created January 12, 2013 20:57
Roll CSS3 Link
/**
* Roll CSS3 Link
*/
body{
margin:100px;
}
a, .ftb-text a {
color: #dd4d42;
font-weight: bold;
text-decoration: none;
<!DOCTYPE html>
<html>
<!-- NOTES
Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. Tested on iPad 1, using IOS 5.1.
This approach uses a set of 3 nested divs.
OuterDiv -- fixed height, width, overflow-scrolling: touch;
MiddleDiv -- fixed height width, overflow-scrolling: touch; fits inside OuterDiv
InnerDiv -- fixed height width, bigger than MiddleDiv, so it kicks in the overflow behavior
// Put all the HTML5 Tags you would like to use in this array
$.each(['article','aside','details','figcaption','figure','footer','header','hgroup','nav','section','summary'],
function(index,value){
$('<'+value+' />');
}
);
@jasondavis
jasondavis / gist:4629057
Created January 24, 2013 22:50
IOS native scroll, but sidestep the document-bounce behavior.
<!DOCTYPE html>
<html>
<!-- NOTES
Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. Tested on iPad 1, using IOS 5.1.
This approach uses a set of 3 nested divs.
OuterDiv -- fixed height, width, overflow-scrolling: touch;
MiddleDiv -- fixed height width, overflow-scrolling: touch; fits inside OuterDiv
InnerDiv -- fixed height width, bigger than MiddleDiv, so it kicks in the overflow behavior