Skip to content

Instantly share code, notes, and snippets.

Instructions here: http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx
sudo apt-get install python-dev bison autoconf libtool-bin swig libpulse-dev
@cash
cash / cla.md
Created February 29, 2016 20:14
CLA

###The Johns Hopkins University Applied Physics Laboratory LLC

Individual Contributor License Agreement ("Agreement")

Thank you for your interest in open source software distributed and/or maintained by The Johns Hopkins University Applied Physics Laboratory LLC (“JHU/APL”). To provide consistent and clear intellectual property licenses to its users, JHU/APL must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor (whether an individual or entity), indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of JHU/APL and its users/licensees; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to JHU/APL. Except for the license granted herein to JHU/APL and recipients of software distributed by JHU/APL, You reserve all right, title, and interest in and

@cash
cash / gist:5928150
Last active December 19, 2015 08:49
Elgg Access System (create, update, and delete)

Creating an entity

  1. Owner check: can write to owner as container (can_write_write_to_container())
  2. Container check: can write to the container as a container (can_write_write_to_container())

Updating an entity

  1. ElggEntity::canEdit()

Deleting an entity

@cash
cash / Elgg access ideas
Created June 24, 2013 03:35
An idea for a simpler API for access
<?php
/**
* Can the user create this content?
*
* @param string $type
* @param string $subtype
* @param ElggEntity $container The container for the new content (null = logged in user)
* @param ElggUser $owner The owner of the new content (null = logged in user)
* @param ElggUser $user The user we're asking permission for (null = logged in user)
@cash
cash / ElggOAuthConsumer.php
Created December 20, 2011 18:15
Elgg OAuth API Plugin
<?php
/**
* Elgg OAuth Consumer Class
*/
class ElggOAuthConsumer {
const ELGG_CLIENT_CONSUMER = 'client';
const ELGG_SERVER_CONSUMER = 'server';
/**
@cash
cash / ElggNotificationEvent.php
Created December 1, 2011 12:45
Elgg 1.9 Notifications API
<?php
/**
* Notification event
*/
class ElggNotificationEvent {
/**
* @var string The name of the action/event
*/
protected $event;
@cash
cash / gist:852092
Created March 3, 2011 00:32
Elgg pre-1.8 svn upgrade for group replies
<?php
/**
* Moves comments to topic posts (replies). Only needed for those running
* an Elgg install based on svn before the 1.8 release. 1.8 release uses
* the same storage of forum topic replies as 1.7.
*
* To run, hit http://example.org/mod/groups/upgrade.php in your browser.
* Obviously, you must copy this script to that location. If you change the
* location, you'll need to update the require statement on start.php.
*/
@cash
cash / Determine data directory of Elgg user
Created September 6, 2010 22:29
Get user's data directory in Elgg 1.7
<?php
/**
* This is just a quick hack to get the data directory for a user
*/
// load engine - this assumes the script has been put in the root directory of Elgg
require_once(dirname(__FILE__) . "/engine/start.php");
global $CONFIG;
@cash
cash / elgglib.php
Created September 5, 2010 23:57
Elgg Menu API for 1.8
/**
* Add an item to an Elgg menu
*
* @param string $menu The name of the menu: site, page, userhover, userprofile, groupprofile, or any custom menu
* @param string $id The unique identifier for this menu item. An example is blog:add
* @param string $title The localized title string for this menu item
* @param string $url The URL for this menu item
* @param array $options An associative array of menu options including: tooltip, parent, context, or custom option.
* tooltip: string that is used as the title element of the link
* parent: the $id of the item's parent