Skip to content

Instantly share code, notes, and snippets.

View johnnyfreeman's full-sized avatar

John Freeman johnnyfreeman

View GitHub Profile
@johnnyfreeman
johnnyfreeman / php
Created April 30, 2023 18:58
PHP Executable that defers to binary inside Laravel Sail
path=$(printf '%s\n' "${PWD##*/}")
command="docker exec ${path}-laravel.test-1 php "$@""
echo "Running php on docker ${path}-laravel.test-1"
$command
@johnnyfreeman
johnnyfreeman / index.css
Created January 31, 2017 21:16
Password Requirements Example
body {
background-color: #7ac44d;
/* IE9, iOS 3.2+ */
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxyYWRpYWxHcmFkaWVudCBpZD0idnNnZyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN4PSIwJSIgY3k9IjEwMCUiIHI9IjE0MS40MjEzNTYyMzczMDk1JSI+PHN0b3Agc3RvcC1jb2xvcj0iI2YzZWYxNSIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAiLz48c3RvcCBzdG9wLWNvbG9yPSIjMDA5ODg1IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMSIvPjwvcmFkaWFsR3JhZGllbnQ+PHJlY3QgeD0iLTUwIiB5PSItNTAiIHdpZHRoPSIxMDEiIGhlaWdodD0iMTAxIiBmaWxsPSJ1cmwoI3ZzZ2cpIiAvPjwvc3ZnPg==);
/* Android 2.3- hack (needed for the actual radial gradient) */
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxyYWRpYWxHcmFkaWVudCBpZD0idnNnZyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN4PSIwJSI
@johnnyfreeman
johnnyfreeman / gist:10268109
Last active August 29, 2015 13:58
Email Signature for work
<table cellpadding="0" cellspacing="0" style="font-family:Helvetica, Arial, sans-serif;font-size:14px;font-weight:normal;color:#3b3d3b;text-align:left;line-height:20px;" >
<tr>
<td style="font-size:40px;font-weight:bold;">
<img src="http://www.gravatar.com/avatar/345b3bc04790827aa3e0a20e873581ce.png" alt="&lt;/" border="0" width="50">
</td>
<td style="padding-left:10px;">
<span style="font-weight: bold;">Johnny Freeman</span>, <span style="color: #999;">Software Developer</span><br>
<a href="http://veroortho.com" style="color:#00a19c;">veroortho.com</a> <span style="color:#999;">|</span> <a href="mailto:[email protected]" style="color:#00a19c;">[email protected]</a> <span style="color:#999;">|</span> <a href="tel:7722573612" style="color:#00a19c;">(772) 257-3612</a>
</p>
</td>
@johnnyfreeman
johnnyfreeman / grubfix
Last active January 1, 2016 22:39
Fix for this Grub issue (https://bugs.archlinux.org/task/37904). Run as root.
#!/bin/bash
# get correct UUID
NUUID=$(lsblk -no UUID /dev/sda1)
# get wrong UUID
OUUID=$(grep -om 1 '[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}' /boot/grub/grub.cfg)
# replace all wrong UUIDs with the correct UUID in the grub config file
sed -i "s/$OUUID/$NUUID/g" /boot/grub/grub.cfg
@johnnyfreeman
johnnyfreeman / gist_tag.rb
Created September 12, 2012 14:27 — forked from imathis/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@johnnyfreeman
johnnyfreeman / Email.php
Created July 27, 2012 17:15
Article: Method Chaining in PHP
<?php
class Email extends BaseEmail {
protected $to = '';
protected $subject = ''
protected $message = '';
public function to($email)
{
@johnnyfreeman
johnnyfreeman / css.css
Created July 3, 2012 15:06
Revolver.js Transition: None
#my_slider {
width: 720px;
height: 300px;
overflow: hidden;
position: relative;
}
#my_slider .slide {
left: 0;
position: absolute;
@johnnyfreeman
johnnyfreeman / gist:1993438
Created March 7, 2012 14:26
CSS: Micro Clearfix
/* http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
@johnnyfreeman
johnnyfreeman / placeholder.jquery.js
Created July 28, 2011 13:44
Placeholder - Just a little js to backup html5's placeholder attribute.
(function($){
$.fn.placeHolder = function() {
// check for placeholder attribute support in current browser
var nativeSupport = "placeholder" in document.createElement("input");
var restorePlaceHolder = function() {
if (this.value == "") {
$(this).addClass('inactive');