Skip to content

Instantly share code, notes, and snippets.

@chrisjdavis
chrisjdavis / gist:33c9f99f40fdc7179cfa
Created August 29, 2014 18:46
Barebones Grunt File
module.exports = function(grunt) {
grunt.initConfig({
concat: {
options: {
separator: '',
},
dist: {
src: ['../scripts/*.functions.js'],
dest: '../js/application.js',
},
@chrisjdavis
chrisjdavis / feasts-plugin
Created January 31, 2012 15:48
Feasts Plugin
<?php
class Feasts extends Plugins
{
public function action_init() {
DB::register_table( 'saints' );
self::setup_db();
}
/**
* setup_db function.
public function action_init() {
DB::register_table( 'activity' );
}
public function action_plugin_activation( $file ) {
$q = "CREATE TABLE " . DB::table('activity') . " (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
user_id int(11) DEFAULT NULL,
owner_id int(11) DEFAULT NULL,
company_id int(11) DEFAULT NULL,
@chrisjdavis
chrisjdavis / chatbox.css
Created October 22, 2012 22:05
Chatbox CSS
.chatbox {
position: fixed;
position:expression("absolute");
width: 300px;
display:none;
}
.chatbox .head {
background-color: #2c2c2c;
background-image: -moz-linear-gradient(top, #333333, #222222);
@chrisjdavis
chrisjdavis / phase1.php
Created October 22, 2012 23:16
Conversations Plugin: Phase 1
<?php
class Conversations extends Plugin
{
public function action_init() {
DB::register_table( 'quickchats' );
DB::register_table( 'quickchat_lines' );
}
public function action_plugin_activation() {
Post::add_new_type( 'quickchat' );
@chrisjdavis
chrisjdavis / html-structure.html
Created October 22, 2012 21:55
Chatbox HTML Structure
<div id="chatbox_1" data-box="1" class="chatbox">
<div class="head">
<div class="title">
<img src="http://website.com/images/john-q-public.png"><strong>John Q. Public</strong>
</div>
<div class="options">
<a class="minimize" href="#minimize">-</a>&nbsp;&nbsp;
<a class="remove" href="#close">x</a>
</div>
<br clear="all">
@chrisjdavis
chrisjdavis / quickchats.php
Created October 23, 2012 20:48
Quickchat Plural Class
<?php
/**
* Quickchats Class
*
*/
class Quickchats extends Posts
{
public static function get($paramarray = array()) {
$defaults = array(
'content_type' => 'quickchat',
@chrisjdavis
chrisjdavis / quickchat.php
Created October 23, 2012 20:48
Quickchat Singular Class
<?php
class Quickchat extends Post
{
public static function get($paramarray = array()) {
$defaults = array(
'content_type' => 'quickchat',
'fetch_fn' => 'get_row',
'limit' => 1,
'fetch_class' => 'Quickchat',
);
<?php
class GooglePrettify extends Plugin {
public function action_template_header() {
Stack::add( 'template_header_javascript', array( $this->get_url() . '/google-code-prettify/prettify.js', 'prettify-js') );
Stack::add( 'template_stylesheet', array( $this->get_url() . '/google-code-prettify/prettify.css', 'screen' ), 'prettify-css');
}
}
?>
@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' );