Skip to content

Instantly share code, notes, and snippets.

View signalpoint's full-sized avatar

Tyler Frankenstein signalpoint

View GitHub Profile
@signalpoint
signalpoint / resend.php
Last active November 19, 2015 18:51 — forked from gavinblair/resend.php
Drupal - resend welcome e-mails on users administration form.
<?php
/**
* Implements hook_user_operations().
*/
function example_user_operations() {
$operations = array(
'example_resend_welcome_email' => array(
'label' => t('Re-send welcome e-mail'),
'callback' => 'example_resend_welcome_email',
@signalpoint
signalpoint / gist:c6f8b1895661f655898b
Last active August 29, 2015 14:18
jQuery Mobile "Toast"
setInterval(function() {
$.mobile.loading('show', {
textVisible: true,
html: '<div style="text-align: center;"><h2>Saved!</h2></div>'
});
setTimeout(function() {
$.mobile.loading().hide();
}, 420);
}, 1);
@signalpoint
signalpoint / gist:a3bf06d1f8bbca5b5292
Created April 29, 2015 20:52
jQuery Mobile Facebook Button
#my-button {
background-color: #4e69a2;
border-color: #435a8b #3c5488 #334c83;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
#my-button:after {
background-image: url("FB-f-Logo__white_29.png"); /* get image from https://www.facebookbrand.com/ */
background-position: 0% 0%;
@signalpoint
signalpoint / example.module
Last active August 29, 2015 14:22
Drupal Devel dpm() on EntityMetaDataWrapper
/**
* @see https://www.drupal.org/documentation/entity-metadata-wrappers
* @example usage: my_dpm($wrapped_object);
*/
function my_dpm($w) {
$values = array();
foreach ($w->getPropertyInfo() as $key => $val) {
$values[$key] = $w->$key->value();
}
$callers = debug_backtrace();
@signalpoint
signalpoint / gist:8f7a12c681ecedc17309
Created June 30, 2015 19:40
Drupal Check User for Multiple Roles
// Returns true if the account has the 'foo' or 'bar' roles.
return count(array_intersect($account->roles, ['foo', 'bar']));
@signalpoint
signalpoint / app.js
Last active October 26, 2017 12:16
NYC Camp 2015 - Building Apps with DrupalGap
'use strict';
// Configure the angular-drupal module.
angular.module('angular-drupal').config(function($provide) {
$provide.value('drupalSettings', {
sitePath: 'http://test.easystreet3.com/drupal', // Example: 'http://example.com' with no trailing slash
basePath: '/',
endpoint: 'drupalgap',
language: 'und',
file_public_path: 'sites/default/files' // use public or private
@signalpoint
signalpoint / customController.php
Created July 23, 2015 21:52
Drupal 8 Output JSON
<?php
// ...
use Symfony\Component\HttpFoundation\Response;
// Then later on (inside your controller's class), you have a function used
// for the route_name (on a hook_menu() item in your .module file), this
// function can return a JSON response...
@signalpoint
signalpoint / README.md
Last active January 25, 2016 21:32
AngularJS Autocomplete with Drupal 8
@signalpoint
signalpoint / .gitignore
Last active January 6, 2017 06:10
jdrupal.easystreet3.com
.idea
7
8
node_modules
@signalpoint
signalpoint / .gitignore
Last active February 19, 2016 19:06
drupalgap.org
7
8
.idea
node_modules
daux.io
api
docs
demo