Skip to content

Instantly share code, notes, and snippets.

View oojacoboo's full-sized avatar

Jacob Thomason oojacoboo

View GitHub Profile
import React from 'react';
interface UserMenuInterface extends React.StatelessComponent<React.HTMLProps> {
user: { firstName: string };
menuItems: JSX.Element;
}
const UserMenu: React.StatelessComponent<UserMenuInterface> = ({ user, menuItems }) =>
/*eslint-disable max-len*/
<li className='inline welcome' id='usermenu'>
[172] ./src/component/Footer.js 5.11 kB {0} [built]
[173] ./src/page/Home.js 23.8 kB {0} [built]
[174] ./src/util/Logger.js 415 bytes {0} [built]
+ 6 hidden modules
ERROR in render is not a function
ERROR in render is not a function
ERROR in render is not a function
$myModule = new \WidgetFactory\Modules\MyModule;
echo $myModule->getOption(\WidgetFactory\Modules\MyModule::SEND_EMAILS);
<?php
namespace WidgetFactory\Modules;
class MyModule extends MyORM
{
const SEND_EMAILS = "sendEmails";
const SHARE_BY_DEFAULT = "shareByDefault";
@oojacoboo
oojacoboo / gist:6025852
Created July 18, 2013 00:44
simple example of a class that has options
<?php
namespace WidgetFactory\Modules;
class MyModule extends MyORM
{
/**
* Shared method to get the option value from the db
* @param string $option
@oojacoboo
oojacoboo / gist:6025798
Last active December 19, 2015 22:09
example of custom named methods to prevent passing strings as params to shared methods
<?php
namespace WidgetFactory\Modules;
class MyModule extends MyORM
{
/**
* Shared method to get the option value from the db
* @param string $option
@oojacoboo
oojacoboo / gist:6025775
Last active December 19, 2015 22:09
Example of a class using custom named method to replace string params
<?php
namespace WidgetFactory\Modules;
class MyModule extends MyORM
{
/**
* Shared method to get the option value from the db
* @param string $option
/**
* Extending the bootstrap tooltip to add new shortcut methods
*/
jQuery.fn.extend($.fn.tooltip, {
alert: function() {
this.show();
}
});
function getMotivationalSalesTeamQuotes() {
$quotes = array();
$quotes[] = "To go beyond is as bad as to fall short. - Anonymous";
$quotes[] = "To handle yourself, use your head; to handle others, use your heart. - Donald Laird";
$quotes[] = "To lead the people, walk behind them. - Lao Tzu";
$quotes[] = "Tough times never last, but tough people do. - Dr. Robert Schuller";
$quotes[] = "Treat people as if they were what they ought to be, and you help them to become what they are capable of being. - Johann Wolfgang von Goethe";
$quotes[] = "Trust men and they will be true to you; treat them greatly, and they will show themselves great. - Ralph Waldo Emerson";
$quotes[] = "You will never find time for anything. If you want time you must make it. - Charles Robert Buxton";
$quotes[] = "The difference between a successful person and others is not a lack of strength, not a lack of knowledge, but rather a lack of will. – Vince Lombardi";
/**
* Gets all the tenants associated with this unit that are current on their lease
* @param bool $includeMovedOutWithBalanceDue
* @return array|PropelCollection
*/
function getCurrentTenants($includeMovedOutWithBalanceDue = false) {
//using array filter to pull cached tenant array from object for speed
return array_filter($this->getTenants()->getData(), function($tenant) use ($includeMovedOutWithBalanceDue) {
return ((!$tenant->getMoveOutDate() || $tenant->getMoveOutDate("U") > time())
|| (!$includeMovedOutWithBalanceDue || $tenant->getBalance() < 0)