Skip to content

Instantly share code, notes, and snippets.

View SpencerCooley's full-sized avatar

Spencer Cooley SpencerCooley

View GitHub Profile
<?php
/**
* Example Application
* @package Example-application
*/
require('../libs/Smarty.class.php');
$smarty = new Smarty;
<form>
<input id="name_input" type="text" value="First Name"/>
</form>
$(function(){
$('#name_input').focus(function(){
$('#name_input').val('');
});
});
$(function(){
//this makes the default value of an input disappear when you focus on the input text field.
//default values reappear when input is unfocused under the condition that value="".
var smart_input = function( input_id, default_value){
$(input_id).focus(function(){
if($(input_id).val() === default_value){
$(this).val('');
$(input_id).focusout(function(){
if($(this).val() === ''){
$(this).val(default_value);
$(function(){
//this makes the default value of an input disappear when you focus on the input text field.
//default values reappear when input is unfocused under the condition that value="".
var smart_input = function( input_id, default_value){
$(input_id).focus(function(){
if($(input_id).val() === default_value){
$(this).val('');
$(input_id).focusout(function(){
if($(this).val() === ''){
$(this).val(default_value);
<form>
<input id="working_name" type="text" value="First Name"/>
</form>
@SpencerCooley
SpencerCooley / gist:1545664
Created December 31, 2011 23:43
command to install sparks , the code igniter package manager.
php -r "$(curl -fsSL http://getsparks.org/go-sparks)"
cd my_code_igniter_project
@SpencerCooley
SpencerCooley / gist:1547976
Created January 1, 2012 18:23
get list of commands for php tools/spark
$ php tools/spark help
<script type=”text/javascript”>
window.location = ‘http://protestsopa.org/‘;
</script>