Skip to content

Instantly share code, notes, and snippets.

View jennatollerson's full-sized avatar

Jenna Tollerson jennatollerson

View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@swichers
swichers / d7-add-entity-view-mode.md
Last active May 24, 2024 23:39
Drupal 7 - Programmatically add view mode to entity

In a module file:

This will enable an additional view mode for use on the specified entity type(s). Many examples will show the custom settings here being set to TRUE. If TRUE is used then that view mode is added to all entities of the specified type regardless of if it should be on the bundle or not.

/**
 * Implements hook_entity_info_alter().
 */
function HOOK_entity_info_alter(&$entity_info) {
@quicksketch
quicksketch / gist:11124800
Last active February 28, 2016 08:22
Alter Webform outgoing e-mail
<?php
/**
* Implements hook_mail_alter().
*/
function mymodule_mail_alter(&$message) {
if ($message['id'] == 'webform_submission') {
// Use the From header as a Reply-to and set the From header to the site
// mail address. Trying to say e-mail is "From" other domains will get the
// mail marked as spam, so instead the e-mail is always from webform.com,
// but the reply address is the user-specified address.
@mgol
mgol / ie11-only.md
Last active May 11, 2023 15:50
How to easily not serve JS and/or CSS to IE<11

Here's how to make your site not load CSS and/or JS in IE older than 11:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=8,9,11">
        <title>Page title</title>
        <!--[if !IE]>-->
 
@espaciomore
espaciomore / watch.sh
Last active August 5, 2024 18:24
Watch command for Git Bash
#!/bin/bash
ARGS="${@}"
clear;
while(true); do
OUTPUT=`$ARGS`
clear
echo -e "${OUTPUT[@]}"
done
@bourke
bourke / plums.py
Created April 13, 2018 18:09
Plums for @ftrain
from bs4 import BeautifulSoup
import requests
def fetch_html():
res = requests.get('https://www.poets.org/poetsorg/poem/just-say')
return res.content
def parse_content(html):
@thesamesam
thesamesam / xz-backdoor.md
Last active March 12, 2025 15:55
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@adrienne
adrienne / mullenweg-wpe.md
Last active March 12, 2025 13:52
The Mullenweg/WPE Thing