Skip to content

Instantly share code, notes, and snippets.

@chrisjdavis
chrisjdavis / gist:4073806
Created November 14, 2012 18:19
Complete Plugin
<?php
class Conversations extends Plugin
{
const APP_ID = 'YOUR_APP_ID';
const API_KEY = 'YOUR API_KEY';
const API_SECRET = 'YOUR_API_SEKRET';
public function action_init() {
DB::register_table( 'quickchats' );
DB::register_table( 'quickchat_lines' );
<?php
function is_subcat( $term ) {
global $wpdb;
$check = $wpdb->get_var( "SELECT terms_id FROM " . $wpdb->prefix . "termsmeta WHERE meta_value = '" . $term . "' AND meta_key = 'non-unique-slug'" );
if( $check == NULL ) {
return false;
} else {
return true;
}
}
@chrisjdavis
chrisjdavis / functions.php
Created December 10, 2012 22:22
Completed functions file
<?php
function is_subcat( $term ) {
global $wpdb;
$check = $wpdb->get_var( "SELECT terms_id FROM " . $wpdb->prefix . "termsmeta WHERE meta_value = '" . $term . "' AND meta_key = 'non-unique-slug'" );
if( $check == NULL ) {
return false;
} else {
return true;
}
}

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@chrisjdavis
chrisjdavis / Ratings.Stars.html
Created March 22, 2013 22:48
HTML structure for Imageless Rating Stars
<div id="stars">
<p>3.5 stars out of 5</p>
<div class="rating">
<i class="icon-rating bottom hide">z</i>
<i class="icon-rating top"><span class="amount hundred">z</span></i>
</div>
<div class="rating">
<i class="icon-rating bottom hide">z</i>
<i class="icon-rating top"><span class="amount hundred">z</span></i>
</div>
@chrisjdavis
chrisjdavis / Rating.Stars.css
Created March 22, 2013 22:50
CSS for Imageless Rating Stars
#stars {
float:left;
width: 100%;
}
#stars p {
text-indent: -99999px;
}
.rating {
float:left !important;
foreach( $dom->find('h4') as $hs ) {
$slug = Utils::slugify( $hs->node->nodeValue );
$heading = $dom->get( $hs );
$heading->id = $slug;
}
public function theme_route_display_docpage($theme) {
$theme->document = Document::get( array('slug' => $theme->matched_rule->named_arg_values['slug']) );
$theme->page = Page::get( array('document_id' => $theme->document->id, 'name' => $theme->matched_rule->named_arg_values['page']) );
$theme->pages = Pages::get( array('document_id' => $theme->document->id, 'orderby' => 'id ASC') );
$theme->title = $theme->document->title . ' &raquo; ' . $theme->page->title;
$theme->post_id = $theme->page->id;
$i = 0;
$str = '';
$dom = new HTMLDoc( $theme->page->content );
public function action_modify_form_habari_login(FormUI $form) {
$form->remove( $form->title );
$form->remove( $form->reset_message );
$buttons = $form->append( FormControlWrapper::create('buttons')->set_setting('wrap_element', 'ul')->set_setting('wrap_each', '<li>%s</li>') );
$form->move_into( $form->login, $buttons );
$form->remove( $form->submit_button );
$buttons->append( FormControlSubmit::create('register')->set_caption('Register?')->on_success(function(){ /* do registraion things */}) );