Skip to content

Instantly share code, notes, and snippets.

View cjwd-snippets's full-sized avatar

cjwd-snippets

View GitHub Profile
@cjwd-snippets
cjwd-snippets / WP Plugin Comment
Last active December 17, 2015 17:58
Wordpress Plugin Comment
<?php
/*
Plugin Name:
Plugin URI:
Description: My Plugin
Version:1.0
Author: Chinara James
Author: http://chinarajames.com
*/
?>
@cjwd-snippets
cjwd-snippets / gist:5359249
Last active December 16, 2015 01:59
clearfix
/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
@cjwd-snippets
cjwd-snippets / snippet.xml
Created November 17, 2012 17:56 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@cjwd-snippets
cjwd-snippets / gist:4074407
Created November 14, 2012 20:00
jQuery: Enable placeholder attribute in old browsers
$(function(){
var d = "placeholder" in document.createElement("input");
if (!d){
$("input[placeholder]").each(function(){
$(this).val(element.attr("placeholder")).addClass('placeholder');
}).bind('focus',function(){
if ($(this).val() == element.attr('placeholder')){
$(this).val('').removeClass('placeholder');
}
}).bind('blur',function(){
@cjwd-snippets
cjwd-snippets / gist:4074392
Created November 14, 2012 19:58
CSS: Form with top labels
form fieldset {
margin: 0 0 20px 0;
font-size: 14px;
}
form fieldset.form-actions {
margin: 0;
}
form fieldset label {
display: block;
margin: 0 0 5px 0;
@cjwd-snippets
cjwd-snippets / gist:4074384
Created November 14, 2012 19:58
HTML: Form with top labels
<form action="/">
<fieldset>
<label for="name">Name</label>
<input type="text" id="name" class="form-text" />
<p class="form-help">This is help text under the form field.</p>
</fieldset>
<fieldset>
<label for="email">Email</label>
<input type="email" id="email" class="form-text" />