Skip to content

Instantly share code, notes, and snippets.

@mikemilano
mikemilano / altlogin.module
Created October 15, 2013 00:06
alt login example
<?php
/**
* @file
* Provides a web service for logging in.
*/
/**
* Implements hook_menu().
*/
function altlogin_menu() {
@mikemilano
mikemilano / gist:6923819
Last active September 18, 2016 03:43
Python's Twisted framework watching a directory and broadcasting changes to zeromq.
from twisted.internet import inotify
from twisted.python import filepath
import zmq
from pprint import pprint
class FileSystemWatcher(object):
def __init__(self, path_to_watch):
self.path = path_to_watch
self.context = zmq.Context()
<?php
// module code
function hook_form_alter(&$form, &$form_state) {
$form['field_foo'][LANGUAGE_NONE][0]['value']['#description_top'] = $form['field_foo'][LANGUAGE_NONE]['#description'];
}
?>
<?php
// template.php
@mikemilano
mikemilano / new_gist_file
Created July 11, 2013 21:52
D8 docker yaml
base_config: &base_config
base_image: ubuntu
dns:
- 8.8.8.8
- 8.8.4.4
containers:
- lb:
config: &lb_container_config
<<: *base_config
user: haproxy