Skip to content

Instantly share code, notes, and snippets.

View anthonysimone's full-sized avatar

Anthony Simone anthonysimone

  • San Francisco, CA
View GitHub Profile
@anthonysimone
anthonysimone / elevatedThirdRecentWork.md
Last active August 29, 2015 14:07
Elevated Third - Recent Work

Anthony Simone's Recent Work

@anthonysimone
anthonysimone / custom_admin.module
Last active August 27, 2015 17:08
Snippet to add some js or css to the Drupal admin theme via a module.
<?php
// Adds to EVERY admin page
function custom_admin_page_build(&$page) {
// Test if on an admin page
if (path_is_admin(current_path())) {
// Get paths
$path = drupal_get_path('module', 'custom_admin');
$theme_path = drupal_get_path('theme', 'themekit');
// Add js and css to customize the admin theme
@anthonysimone
anthonysimone / _mixins-foundation.scss
Last active June 27, 2016 21:14
Some useful mixins to extend Foundation Sites functionality.
////
/// Foundation related mixins
/// @group foundation-extensions
////
/// Regular Grid - Sizes DIRECT child elements so that `$n` number of items appear on each row.
/// @param {Number} $n - Number of elements to display per row.
/// @param {String} $selector ['.column'] - Selector(s) to use for child elements.
@mixin grid-layout-child(
@anthonysimone
anthonysimone / foundation.tabsToSelect.js
Last active April 12, 2016 14:51
When using Foundation Sites Tabs component, for each tab component, create a select list that stays in sync with tabs.
!function ($) {
// Always use strict mode to enable better error handling in modern browsers.
"use strict";
// For every foundation tab container, create a select list that stays in sync with tabs
$(document).ready(function() {
// Get all tabs on page
var $allTabs = $('.f-tabs');
@anthonysimone
anthonysimone / _app.scss
Created June 27, 2016 19:56
_app.scss Foundation 6 partial import for themekit
/**
* Foundation for Sites by ZURB
* Version 6.2.3
* foundation.zurb.com
* Licensed under MIT Open Source
*/
@import "settings";
@import "foundation";
@anthonysimone
anthonysimone / bulk_actions_alter.php
Created December 8, 2016 23:20
Add a default `null` selection to the bulk actions dropdown on the main content page so `delete` is not the default action.
/**
* Implements hook_form_FORM_ID_alter().
*
* Specifically get the view content page form, look for the bulk field in the header, and add a non-item as default
*/
function HOOK_form_views_form_content_page_1_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
if (isset($form['header']['node_bulk_form']['action']['#type']) && $form['header']['node_bulk_form']['action']['#type'] === 'select') {
$form['header']['node_bulk_form']['action']['#options'] = array('' => '- Select Action -') + $form['header']['node_bulk_form']['action']['#options'];
}
}
@anthonysimone
anthonysimone / README.md
Last active December 2, 2021 21:47
How a Browser Works

How a Browser Works

   

   

Diagram