Skip to content

Instantly share code, notes, and snippets.

View DevJMD's full-sized avatar

James Martin-Davies DevJMD

View GitHub Profile
@DevJMD
DevJMD / index.html
Created October 29, 2014 11:29
JavaScript Snow (Christmas)
<!doctype html>
<html>
<head>
<title>SnowJS</title>
<script src="snow.js"></script>
</head>
<body>
<canvas id="snow"></canvas>
</body>
</html>
@DevJMD
DevJMD / main.js
Last active August 29, 2015 14:14
SnowJS Prototype Inheritance
var snow = new SnowJS('snow');
// Or...
var snow = new SnowJS('snow', { /* Options */ });
@DevJMD
DevJMD / dropbox.py
Created March 16, 2015 09:09
Ignore Dropbox Files (OS X)
#!/bin/bash
set -e
# SETTINGS
dropbox_folder="/Users/James/Dropbox"
# Location of dropbox.py (http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli)
dropbox_script="~/bin/dropbox.py"
# Array of folders to ignore
ignore_list=['bower_components','node_modules','vendor']

PlumpJS Utility

Simple, native JavaScript utility functions without any dependencies. Fast, simple, does the job.

Dependencies

None, zero, zlitch.

Compatibility

IE Chrome Firefox Opera Safari Mobile (BB, Opera, FF, IE, Android)
/**
* PlumpJS Utility
* Version: 0.1.0
*/
/* global define: false */
;(function(root, factory) {
'use strict';
;(function() {
'use strict';
var PLUGIN_NAME = 'MyPlugin';
/**
* Constructor
*/
function Constructor(element, options) {
/**
<?php
class Person extends DataObject {
private static $has_one = array(
'Photo' => 'Image',
);
private static $db = array(
'FirstName' => 'Varchar(32)',
<?php
class AboutPage extends Page {
private static $db = array(
);
<?php
class ContactPage extends Page {
private static $db = array(
'Email' => 'Varchar(250)',
'AddressLine1' => 'Varchar(64)',
'AddressLine2' => 'Varchar(64)',
'AddressLine3' => 'Varchar(64)',
'AddressCity' => 'Varchar(64)',
<?php
class PersonAdmin extends ModelAdmin {
private static $managed_models = array(
'Person'
);
private static $menu_title = 'Persons';