Skip to content

Instantly share code, notes, and snippets.

View jamesdixon's full-sized avatar

James Dixon jamesdixon

View GitHub Profile
@jamesdixon
jamesdixon / plv8-javascript-modules-loading.sql
Last active October 22, 2015 06:08 — forked from rafaelveloso/plv8-javascript-modules-loading.sql
How to load Javascript modules into postgres using plv8
\set rrule `cat rrule.js`
/******************************************************************************
Now that we have set variable containing the code
we need to create a table to store each of them in
postgres.
******************************************************************************/
create table plv8_modules(modname text primary key, load_on_start boolean, code text);
@jamesdixon
jamesdixon / custom-fonts.php
Created March 9, 2015 21:54
Wordpress Allow Custom Font Upload
<?php
// add to your theme's functions.php file
add_filter('upload_mimes', 'add_custom_upload_mimes');
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes['otf'] = 'application/x-font-otf';
$existing_mimes['woff'] = 'application/x-font-woff';
$existing_mimes['ttf'] = 'application/x-font-ttf';
$existing_mimes['svg'] = 'image/svg+xml';
$existing_mimes['eot'] = 'application/vnd.ms-fontobject';
return $existing_mimes;