Skip to content

Instantly share code, notes, and snippets.

View s4parke's full-sized avatar

Steve J. s4parke

View GitHub Profile
@Satak
Satak / terraform-test.ps1
Created December 31, 2021 07:07
Terraform unit test with Pester/Powershell
BeforeDiscovery {
$testCases = Get-ChildItem -Path (Join-Path $PSScriptRoot examples) -Directory
}
describe 'terraform-module-storage - <_.Name>' -ForEach $testCases {
BeforeAll -ErrorAction Stop {
$exampleName = $_
Push-Location $exampleName
Write-Host "Test case: $($ExampleName.Name)" -Foreground Magenta
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

#!/bin/bash
# Script to clean up after Enterprise-Scale - DO NOT RUN IN PRODUCTION
echo "THIS SCRIPT WILL DESTROY YOUR AZURE ENVIRONMENT"
read -n 4 -p "Are you SURE you want to do this? (type 'yes' to continue): " YES
if [ ! "$YES" == "yes" ]; then
echo "Confirmation denied - quitting"
exit 0
@MartijnR
MartijnR / enketo-compliant-widget-template
Last active September 5, 2017 16:12
Enketo-compliant Widget Template
'use strict';
/**
* My Fancy Widget
*
* A jQuery plugin form widget that is compatible with Enketo Smart Paper
* and extends a base Enketo Widget class (see https://github.com/enketo/enketo-core)
*/
var Widget = require('../../js/Widget');
@codearachnid
codearachnid / custom_venue_info.php
Created July 18, 2013 18:39
Add custom venue meta items by using the tribe_register_meta for individual items or tribe_register_meta_group for the group registration. See TEC (core plugin)/public/advanced-functions/meta.php for examples of group and individual registration
<?php
// add custom venue meta items
add_action('tribe_events_before_view','custom_venue_info');
function custom_venue_info(){
global $post;
// force this to run only on single event views
if( is_single() && tribe_is_event( $post->ID ) ){
$room = get_post_meta( $post->ID, '_VenueRoom', true );
tribe_register_meta( 'tribe_venue_room', array(
@stephanieleary
stephanieleary / wp_private_page_filters.php
Last active March 7, 2018 12:41
Private page filters for WordPress. Related to ticket #8592.
<?php
/*
Plugin Name: Unpublished Hierarchies
Description: A tiny plugin to allow draft, private, scheduled, and password-protected pages to be selected as parents.
Author: Stephanie Leary
Version: 1.0
Author URI: http://stephanieleary.com
License: GPL2
*/
@karmi
karmi / .gitignore
Created August 16, 2012 12:00
Ember.js application with elasticsearch persistence and Goliath based proxy [http://www.elasticsearch.org/tutorials/2012/08/22/javascript-web-applications-and-elasticsearch.html]
.DS_Store
tmp/
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@amardaxini
amardaxini / add.js.erb
Created August 17, 2011 08:56
redis i18n
<tr>
<td><%[email protected](".").drop(1) %></td>
<td><%= @value%></td>
</tr>
add_index :attachments, :parent_id
add_index :attachments, :asset_id
add_index :domain_names, :user_id
add_index :domain_names, :event_id
add_index :event_memberships, :user_id
add_index :event_memberships, :event_id
remove_index :attachments, :parent_id
remove_index :attachments, :asset_id
remove_index:domain_names, :user_id
remove_index:domain_names, :event_id