Skip to content

Instantly share code, notes, and snippets.

View christopher-hopper's full-sized avatar
:octocat:
contributing

Christopher Hopper christopher-hopper

:octocat:
contributing
View GitHub Profile
@tristan0x
tristan0x / README.md
Last active August 7, 2017 01:38
Git commit client hook

Git commit client hook

Provides Git hook enforcing commit message.

  • first line length must be less than 50 characters.
  • if applicable, second line may be empty.
  • length of every lines may be less than 72 characters.

Installation instructions

@eporama
eporama / phpenv-osx.sh
Last active October 14, 2017 11:04 — forked from webbj74/phpenv-osx.sh
Setup multiple versions of PHP on OSX using homebrew
#!/usr/bin/env bash
# Use this script to install or re-install multiple versions of PHP
# You should be able to re-run the script multiple times; it will update/reinstall what it needs.
# Check OS
if [ "${OSTYPE//[0-9.]/}" != "darwin" ]; then
echo "This script is intended for OSX users."
exit
@DavidHernandez
DavidHernandez / d7-autologin.php
Created October 16, 2014 17:19
This is another PoC for the SA-CORE-2014-005 vulnerability. Instead of updating the users table, activates an anonymous session to change your session into admin.
<?php
/**
* D7 autologin.
* Exploits SA-CORE-2014-005 to change your anonymous session into an uid 1 session.
* In order to work, first you need to have an anonymous session in the sessions table.
* One way to achieve this is to go to the update.php page.
*
* Usage: php d7-autologin.php http://example.com 127.0.0.1
*
@chusiang
chusiang / teams-chat-post.sh
Last active March 21, 2024 10:55
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post.sh
# Modified: 2021-10-18 00:09
# Description: Post a message to Microsoft Teams.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
#
@DanLaufer
DanLaufer / list_paragraphs_used.php
Last active April 3, 2024 15:10
Drupal 8 - List all paragraphs referenced in a field and frequency used across all content types
<?php
use Drupal\paragraphs\Entity\Paragraph;
$field_name = 'field_my_field';
$query = \Drupal::entityQuery('node');
$node_ids = $query
->condition('status', 1)
->exists($field_name)