Skip to content

Instantly share code, notes, and snippets.

sodacrackers /
Created Jan 3, 2020
Git post commit deploy
# set -x
# set -v
# This script deploys your code to the production/ LIVE site.
# To make use of this git hook, it can be copied to `.git/post-commit`
# in the folder root. It's then triggered after each git commit.
# Git offers hooks on many different git activities and, this custom
sodacrackers / simple_shibb.module.php
Created Jan 13, 2017
Drupal 7 Shibboleth 2 Authentication Module
View simple_shibb.module.php
function simple_shibb_init() {
$shib_session = _simple_shibb_get_session_username();
$drupal_session = user_is_logged_in();
if($drupal_session && !$shib_session) {
$force_logout = _simple_shibb_get_setting('logout_expired_sessions');
sodacrackers / UpdateSPContentSourceFromRSS.ps1
Created Oct 30, 2016
PowerShell to update SharePoint 2013 search content source start addresses from a remote RSS feed
View UpdateSPContentSourceFromRSS.ps1
Write-Host "---"
Write-Host "--- Starting job $MyInvocation.ScriptName"
Write-Host "--- Copies URLs from SharePoint list to the URLs list of a search content source"
Write-Host "---"
Add-PSSnapin Microsoft.SharePoint.PowerShell
function Execute-Updates {
sodacrackers / powershell-refresh-deploy.ps1
Last active Jan 3, 2020
PowerShell to backup folders, download git repo, and create IIS site for Drupal
View powershell-refresh-deploy.ps1
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
$verbosePreference = "Continue"
// Relies on Powershell.MWA for Internet Information Servives routines
// Download to .\Powershell.MWA-master
// @see
Import-Module WebAdministration
Import-Module "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\Powershell.MWA-master\Powershell.MWA.psm1"
Push-Location $env:temp
sodacrackers / mac_yosemite_windows_startup_choice.scpt
Created Sep 22, 2015
Mac 10.10 Mac Yosemite - Parallels Desktop OS Chooser Login Items Script
View mac_yosemite_windows_startup_choice.scpt
-- From Mac ScriptEditor, export as "Application" and add to startup items
set os_mac to "Mac"
set os_windows to "Windows 7"
set os_choice to os_mac
set os_windows_image to POSIX file "/Users/Shared/Parallels/Windows 7.pvm"
set log_file to "/log.txt"
sodacrackers / template.php
Created Sep 8, 2015
Drupal 7 - Primary tabs with Bootstrap dropdown and Font Awesome icons
View template.php
// Snippet for template.php file
// Two Drupal hooks to move primary tabs into a dropdown and, to use
// fontawesome icons for Drupal's edit menue. Requires Bootstrap components and Fontawesome CSS.
// Better than a module.
function THEME_menu_local_tasks(&$variables)
$output = '<div class="btn-group pull-right sphsc-tab-tasks">'
. '<button class="btn btn-info btn-lg dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'
. t('Actions') . '<span class="caret"></span></button>'
You can’t perform that action at this time.