Skip to content

Instantly share code, notes, and snippets.

View smithmilner's full-sized avatar

Smith Milner smithmilner

View GitHub Profile
@smithmilner
smithmilner / config.yml
Created October 7, 2014 23:35
HWIOAuthBundle EVE Online resource owner
hwi_oauth:
firewall_name: main
resource_owners:
eve_online:
type: oauth2
client_id: %eve_online_sso.client_id%
client_secret: %eve_online_sso.client_secret%
access_token_url: %eve_online_sso.domain%/oauth/token
authorization_url: %eve_online_sso.domain%/oauth/authorize
infos_url: %eve_online_sso.domain%/oauth/verify
@smithmilner
smithmilner / .gitconfig
Created June 5, 2014 19:13
My general purpose git settings.
[user]
name = Smith Milner
email = [email protected]
# download this file in your home directory and rename it .gitconfig
[branch]
autosetuprebase = always
[color]
ui = auto
[color "status"]
added = green
@smithmilner
smithmilner / Doctrine-ManyToMany.php
Created February 7, 2014 02:07
Example of a ManyToMany Relationship in Doctrine.
<?php
/** @Entity */
class User
{
/** @Id @GeneratedValue @Column(type="string") */
private $id;
/**
* Bidirectional - Many users have Many favorite comments (OWNING SIDE)
*
@smithmilner
smithmilner / Doctrine-OneToMany.php
Last active August 29, 2015 13:56
Example of a OneToMany Relationship in Doctrine.
<?php
/** @Entity */
class User
{
/** @Id @GeneratedValue @Column(type="string") */
private $id;
/**
* Bidirectional - One-To-Many (INVERSE SIDE)
*
/**
* Returns HTML for a generic HTML tag with attributes.
*
* @param $variables
* An associative array containing:
* - element: An associative array describing the tag:
* - #tag: The tag name to output. Typical tags added to the HTML HEAD:
* - meta: To provide meta information, such as a page refresh.
* - link: To refer to stylesheets and other contextual information.
* - script: To load JavaScript.
SELECT uid, name, mail
FROM users
WHERE mail IN (
SELECT mail
FROM users
GROUP BY mail
HAVING count(mail) > 1
)
ORDER BY mail, uid
@smithmilner
smithmilner / boxes_twitter.inc
Created June 7, 2011 17:44
A custom box plugin for twitter pull.
<?php
/**
* Custom Twitter Box
*/
class boxes_twitter extends boxes_box {
/**
* Implementation of boxes_box::options_defaults().
*/
public function options_defaults() {
@smithmilner
smithmilner / drupal remove page title
Created March 14, 2011 22:31
Put this function in your theme's template.php and rename it accordingly. Also set your title as the return of this function in preprocess_page ie: function mytheme_preprocess_page($vars) { $vars['title'] = mytheme_page_title(); } It operates lik
/**
* Set the title of the current page, for display on the page and in the title bar.
* Title is removable if you pass <none> as a variable.
*
* @param $title
* Optional string value to assign to the page title; or if set to NULL
* (default), leaves the current title unchanged.
*
* @return
* The updated title of the current page.