Skip to content

Instantly share code, notes, and snippets.

View kreitje's full-sized avatar

Jeff Kreitner kreitje

View GitHub Profile
@kreitje
kreitje / Minikube Authorize Docker Private Images
Created April 22, 2019 18:20
Minikube authorize docker hub
kubectl create secret docker-registry --dry-run=true regcred \
--docker-server=https://index.docker.io/v1/ \
--docker-username=$USERNAME \
--docker-password=$PASSWORD \
--docker-email=$EMAIL -o yaml > docker-secret.yaml
#Then run
kubectl apply -f docker-secret.yaml
#Then in the spec -> template -> spec add imagePullSecrets: with a -name: regcred
@kreitje
kreitje / RefreshCommand.php
Created December 12, 2013 17:15
Laravel 4 commands that can work remotely while be called on a local system.
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class RefreshCommand extends RemoteSupportCommand {
protected $name = 'mysite:refresh';
protected $description = 'My description';
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<input class="hms_testimonials_cf_provider" />
<script type="text/javascript">
jQuery(document).ready(function() {
<?php
/* add everything below here to the themes functions.php file */
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post">
' . __( "This post is password protected. To view it please enter your password below:" ) . '
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
@kreitje
kreitje / fabfile.py
Created November 11, 2013 17:07
Fabfile simple deploy script
from fabric.api import *
import os
import os.path
import datetime
now = datetime.datetime.now()
# Where to save the tar file on the local machine
TAR_FILE = '/Users/kreitje/Desktop/site.tar'
@kreitje
kreitje / gist:7057857
Last active December 25, 2015 23:29
My Sublime Text 2 user preferences
// Settings in here override those in "Default/Preferences.sublime-settings", and
// are overridden in turn by file type specific settings.
{
"ignored_packages":
[
"Vintage"
],
"font_size": 12,
"word_wrap": false,
@kreitje
kreitje / shortcodes.php
Created August 22, 2013 13:47
Updated shortcodes file.
<?php
function hms_testimonials_form( $atts ) {
global $wpdb, $blog_id, $current_user;
get_currentuserinfo();
$settings = get_option('hms_testimonials');
$fields = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix."hms_testimonials_cf` WHERE `blog_id` = ".$blog_id." ORDER BY `name` ASC");
@kreitje
kreitje / recaptchalib.php
Created August 3, 2013 15:22
Slightly modified recaptchalib.php for decoding fsockopen errors
<?php
/*
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* http://recaptcha.net/plugins/php/
* - Get a reCAPTCHA API Key
* https://www.google.com/recaptcha/admin/create
* - Discussion group
* http://groups.google.com/group/recaptcha
*
# Where is the folder with the code
mp=/Users/kreitje/Development/wordpresspluginmanager
# Where is it going to
rp=/Users/kreitje/Desktop/WPM
echo "Removing old directories"
echo "Creating new directories"
rm -rf /Users/kreitje/Desktop/WPM
mkdir -p /Users/kreitje/Desktop/WPM/Default
@kreitje
kreitje / floats.html
Created November 8, 2012 17:35
CSS Floats
<html>
<head>
<title>Float Example</title>
<style type="text/css">
/**
* This CSS is only for the demo and doesn't affect floats
**/
div {
border:1px solid #000;