Skip to content

Instantly share code, notes, and snippets.

View pixel5's full-sized avatar
💭
"You know what our users really want? To update their status." -github

Aaron Baxter pixel5

💭
"You know what our users really want? To update their status." -github
View GitHub Profile
@pixel5
pixel5 / byoc_seat.php
Last active August 29, 2015 14:20
byoc_seat
<?php
class byoc_seat {
public $number;
public $name;
public $clan;
function __construct($number, $name, $clan) {
$html_classes = array(
'byoc',
@pixel5
pixel5 / button.php
Created May 5, 2015 18:18
For ashopin
<?php
function YOURMODULE_form($form,&$form_state) {
// ... the rest of your form ...
$form['email_button'] = array(
'#type' => 'button',
'#value' => 'Send Email',
'#ajax' => array(
'event' => 'click',
@pixel5
pixel5 / my_module.info
Last active August 29, 2015 14:20
my_module.info
name = My Module
description = "My module is pretty darn awesome."
package = Awesome Modules
core = 7.x
stylesheets[all][] = my_module.css
files[] = MyPackage/ClassName.php
@pixel5
pixel5 / form_example_1.php
Created May 15, 2015 17:39
Form Example 1
<?php
function MYMODULE_example_form($form, &$form_state) {
$form = array();
$form['name'] = array(
'#type' => 'textfield',
'#title' => t("Your Name"),
);
@pixel5
pixel5 / form_example_2.php
Last active August 29, 2015 14:21
Form Example 2
<?php
// This is your page function, where your content is rendered.
// $id is a 'page argument' (see Drupal hook_menu documentation)
function MYMODULE_page_function($id) {
$output = '';
// MYMODULE_get_values represents a function for a query that
// retrieves values from the database and accepts $id as an
// argument to be used as a query condition.
@pixel5
pixel5 / inputgroup_example_form.php
Created June 1, 2015 18:22
input-group example form
<?php
function inputgroup_example_form($form,&$form_state) {
$form = array();
$form['i'] = array(
'#type' => 'textfield',
'#attributes' => array(
'placeholder' => 'input-groups in drupal!',
),
@pixel5
pixel5 / quote.py
Created June 16, 2015 18:53
BigBen Quote Module
import irclib
import random
class quote:
def on_pubmsg(self, nick, connection, event):
message = event.arguments()[0]
source = event.source().split('!')[0]
# Retrieve stored quote
if message.startswith(".quote"):
words = message.split()
@pixel5
pixel5 / blaseit.py
Created July 17, 2015 16:25
BigBen .blazeit
import irclib
import random
import datetime
class blazeit:
def on_pubmsg(self, nick, connection, event):
message = event.arguments()[0]
source = event.source().split('!')[0]
# Retrieve stored quote
@pixel5
pixel5 / blazeit.py
Created August 19, 2015 15:30
.blazeit command for BigBen
import irclib
import random
import datetime
class blazeit:
def on_pubmsg(self, nick, connection, event):
message = event.arguments()[0]
source = event.source().split('!')[0]
# Retrieve stored quote
@pixel5
pixel5 / blazeit_snip.py
Created September 23, 2015 19:28
blazeit upgrade
if number == 420 and source == "g2wolf":
response = "Oh look g2wolf has rolled yet another illegitimate 420."
elif number == 420:
response = u"{0} \u00034ROLLED A \u00038DANK 420 \u00033#SMOK".format(source)
elif number != 0:
response = source + " rolled " + str(number)