Skip to content

Instantly share code, notes, and snippets.

View Harrisonbro's full-sized avatar

Harrison Brown Harrisonbro

View GitHub Profile
#!/bin/bash
set -eo pipefail
if [ "$MYSQL_RANDOM_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
# there's no way we can guess what the random MySQL password was
echo >&2 'healthcheck error: cannot determine random root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
exit 0
fi
host="$(hostname --ip-address || echo '127.0.0.1')"
@Harrisonbro
Harrisonbro / Sass-parallax-example.markdown
Created January 27, 2014 09:51
A Pen by Scott Kellum.

Sass parallax example

By locking the perspective on the body element and transforming elements in 3D on top of that, you can easily create parallax scrolling effects that don’t require JavaScript and can be much more performant as a result. Mixins can be found here: http://codepen.io/scottkellum/pen/Jwudg

A Pen by Scott Kellum on CodePen.

License.

var subpixelWordSpacing = false;
if (document.defaultView && document.defaultView.getComputedStyle) {
var originalSpacing = document.defaultView.getComputedStyle(document.documentElement, null).wordSpacing;
document.documentElement.style.wordSpacing = '0.5px';
subpixelWordSpacing = document.defaultView.getComputedStyle(document.documentElement, null).wordSpacing === '0.5px';
document.documentElement.style.wordSpacing = originalSpacing;
}
@Harrisonbro
Harrisonbro / Class-mixin.scss
Created August 14, 2013 17:33
Generate a solid class (for use in markup) and a silent class (for use with @extend) in one go.
/**
* Generate a solid class (for use in markup) and a silent class (for use with
* `@extend`) in one go.
*
* Created by csswizardry at http://jsfiddle.net/csswizardry/ECntr/
*/
@mixin class($name) {
.#{$name},
%#{$name} {
@content
@Harrisonbro
Harrisonbro / gist:4038361
Created November 8, 2012 11:51
BAPO-104 | Insurance table HTML and modal info boxes
<h3>What your policy covers:</h3>
<table class="table table-striped table-bordered">
<tbody>
<tr align="left">
<th>Cover</th>
<th>Limit</th>
</tr>
<tr>
<td>Medical Expenses <a href="#medical" role="button" data-toggle="modal">(details)</a></td>
@Harrisonbro
Harrisonbro / SassMeister-input.scss
Created February 19, 2015 16:34
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@function strip-unit($num) {
@if type-of($num) == "number" {
@return $num / ($num * 0 + 1);
} @else {
@warn "Not a number value: #{num}";
@return $num;
@Harrisonbro
Harrisonbro / SassMeister-input.scss
Created February 19, 2015 16:33
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@function strip-unit($num) {
@if type-of($num) == "number" {
@return $num / ($num * 0 + 1);
} @else {
@warn "Not a number value: #{num}";
@return $num;
@Harrisonbro
Harrisonbro / SassMeister-input.scss
Created February 19, 2015 16:33
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@function strip-unit($num) {
@if type-of($num) == "number" {
@return $num / ($num * 0 + 1);
} @else {
@warn "Not a number value: #{num}";
@return $num;
@Harrisonbro
Harrisonbro / SassMeister-input.scss
Last active August 29, 2015 14:15
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@function strip-unit($num) {
@if type-of($num) == "number" {
@return $num / ($num * 0 + 1);
} @else {
@warn "Not a number value: #{num}";
@return $num;
@Harrisonbro
Harrisonbro / SassMeister-input.scss
Last active August 29, 2015 14:15
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@function strip-unit($num) {
@if type-of($num) == "number" {
@return $num / ($num * 0 + 1);
} @else {
@warn "Not a number value: #{num}";
@return $num;