Skip to content

Instantly share code, notes, and snippets.

@jackfoust
jackfoust / lando.yml
Created May 3, 2019 18:23 — forked from dustinleblanc/lando.yml
Browsersync Lando
proxy:
mannequin:
- appname-styleguide.lndo.site
node:
- appname-bs.lndo.site:3000
services:
mannequin:
type: compose
services:
image: php:7.3
@jackfoust
jackfoust / lando_site_audit.sh
Last active August 23, 2018 14:32
Lando - Add Site Audit
lando ssh appserver
cd ~/.drush
mkdir commands
cd commands
wget <site audit.tar.gz>
tar xvfz <site audit.tar.gz>
exit
#You may need to switch to a branch where you aren't doing site audit things to be able to `lando drush cc drush`

Keybase proof

I hereby claim:

  • I am jackfoust on github.
  • I am jackfoust (https://keybase.io/jackfoust) on keybase.
  • I have a public key ASC6Gkj11NlFC9IJZZv6hGmj_QyPhd85TpKFlKeeWaVS3Qo

To claim this, I am signing this object:

@jackfoust
jackfoust / Sanitize_Target_Blank.htm
Created August 30, 2017 19:45 — forked from JamoCA/Sanitize_Target_Blank.htm
Use jQuery to automatically add noopener, noreferrer and nofollow to links w/target="_blank".
<cfcontent type="text/html; charset=UTF-8">
<!doctype html>
<html lang="en">
<head>
<title>Sanitize target="_blank"</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js" type="text/javascript"></script>
<script type="text/javascript">
/* 3/24/2017 Sanitize_Target_Blank.htm https://gist.github.com/JamoCA/80f65eb07f054b1326221bd4f15868d6 */
function sanitizeTargetBlank(){
$('#linkDiv a[rel~=external]').prop('target', '_blank');
@jackfoust
jackfoust / settings.php
Last active November 4, 2015 14:20
Drupal 7.40 settings.php changes.
# DIFF REPLACE
-$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
+$conf['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//';
# ADD TO END OF FILE
/**
* Theme debugging:
*
* When debugging is enabled:
@jackfoust
jackfoust / .htaccess
Last active November 4, 2015 14:20
Drupal 7.40 .htaccess change
# ADD TO END OF FILE
# Add headers to all responses.
<IfModule mod_headers.c>
# Disable content sniffing, since it's an attack vector.
Header always set X-Content-Type-Options nosniff
</IfModule>
@jackfoust
jackfoust / iwlist
Created July 19, 2015 13:53
find channels local wifi utilizing
sudo iwlist wlan0 scan | grep \(Channel
@jackfoust
jackfoust / Drupal Form API + WYSIWYG
Created January 23, 2015 23:21
WYSIWYG with Drupal Form API
<?php
$defaults = array(
'value' => '',
'format' => filter_default_format(),
);
$example = variable_get('example_variable', $defaults);
$form_['example'] = array(
'#title' => t(''),
'#type' => 'text_format',
@jackfoust
jackfoust / Drupal Blocks with Mobile Detect
Created October 30, 2014 02:27
#drupal Experimental Block Rendering by Device. Drupal 7
<?php
/**
* @file
* A test case for adding visibility settings of Desktop, Tablet and Mobile to Drupal block rendering. Dropped instead for Context + Mobile Detect Library
*/
define('MOBILE_DETECT_LIBRARY_PATH', '/sites/all/libraries/Mobile_Detect');
/**
* Implements hook_form_alter().
@jackfoust
jackfoust / Custom Token
Last active August 29, 2015 14:08
#drupal Custom Token. Drupal 7
<?php
/**
* @file
* Creates a custom token. In this case this token was sent to Google Analytics.
*/
function example_token_info() {
$info['tokens']['site']['active_alert'] = array(
'name' => t('Active Alert'),