Skip to content

Instantly share code, notes, and snippets.

View dgrebb's full-sized avatar

Dan Grebb dgrebb

View GitHub Profile
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@mixin pointer($background, $borderwidth, $bordercolor, $arrowsize, $arrowposition) {
background: $background;
border: $borderwidth solid $bordercolor;
&:after, &:before {
@if $arrowposition == 'top' {
bottom: 100%;
left: 50%;
}
@if $arrowposition == 'bottom' {
top: 100%;
@dgrebb
dgrebb / gist:10a49eb39de0759d6499
Created February 19, 2015 18:53
Match all opening and closing tags as well as their content
(<lastmod>)(.*)(</lastmod>)
@dgrebb
dgrebb / php-get-last-url-segment.php
Last active November 3, 2022 01:24
PHP - get the last URL segment
<?php
// finds the last URL segment
$urlArray = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$segments = explode('/', $urlArray);
$numSegments = count($segments);
$currentSegment = $segments[$numSegments - 1];
?>
<?php if ( $currentSegment == "index.php" ) { ?>active<?php } ?>
@dgrebb
dgrebb / sfwd-snippets.scss
Last active August 29, 2015 14:10
Sass For Web Designers code snippets
/*----------------------------------------*\
This is a collection of snippets from the
A Book Apart publication "Sass For Web
Designers", by Dan Cederholm.
\*----------------------------------------*/
$width-small: 400px;
$width-medium: 760px;
$width-large: 1200px;
@dgrebb
dgrebb / gist:435e96ab7e747ef9aad5
Last active August 29, 2015 14:04
Installs and sets up homebrew, apache, mysql, and php on a mac.
#!/bin/bash
# installs and sets up homebrew, apache, mysql, and php on a mac
echo ''
echo 'Installing and configuring Homebrew.'
echo ''
# install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@dgrebb
dgrebb / gist:8695622
Created January 29, 2014 19:51
Python script automates Browserstack screengrabbing
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import simplejson
# Set up an array of the browsers we test on
browser_array = [
{'browser': 'IE', 'browser_version': '8.0', 'os': 'Windows', 'os_version': '7', 'resolution': '1024x768'},
{'browser': 'IE', 'browser_version': '9.0', 'os': 'Windows', 'os_version': '7', 'resolution': '1024x768'},
{'browser': 'IE', 'browser_version': '10.0', 'os': 'Windows', 'os_version': '8', 'resolution': '1024x768'},