Skip to content

Instantly share code, notes, and snippets.

View trevor-atlas's full-sized avatar
👾
Variety is the spice of life, or something

Trevor Atlas trevor-atlas

👾
Variety is the spice of life, or something
View GitHub Profile
@trevor-atlas
trevor-atlas / pageCheck.js
Last active August 29, 2015 14:08
check the path name of the current URL, nice for conditional scripts.
var path = window.location.pathname.split('/')[1] || '/',
pageCheck = function(string) {
if (path === '/') {
path = 'home';
}
if (path !== string) {
return false;
}
return true;
@trevor-atlas
trevor-atlas / remcalc.js
Last active August 29, 2015 14:08
convert between rem and px
var style = window.getComputedStyle(document.documentElement, null).getPropertyValue('font-size'),
fontSize = parseInt(style),
calcUnit = function(fn, unit) {
return fn(unit);
},
px = function(rem) {
return rem * fontSize;
// rem -> px
@trevor-atlas
trevor-atlas / zoomitbig
Created October 25, 2014 19:01
Cool wobbly animation seen in the footer of http://bjango.com/mac/istatmini/
@-webkit-keyframes zoomit {
15%,40%,75%,100% {
-webkit-transform-origin: center center;
}
15% {
-webkit-transform: scale(1.2, 1.1);
}
40% {
switch (new Date().getDay()) {
case 0:
day = "Sunday";
break;
case 1:
day = "Monday";
break;
case 2:
day = "Tuesday";
break;
@trevor-atlas
trevor-atlas / gist:830144ed2fc7b4251270
Last active August 29, 2015 14:06
base 64 1×1 GIF
transparent
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
black
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=">
source: http://css-tricks.com/snippets/html/base64-encode-of-1x1px-transparent-gif/
<!-- -->
@trevor-atlas
trevor-atlas / wp-config.php
Last active August 29, 2015 14:03
One file for local and dev wordpress (fixes urls to point locally instead of live)
/** MySQL settings - You can get this info from your web host */
$env = $_SERVER['HTTP_HOST'];
if ($env == 'dev.local' || $env == 'www.dev.local') {
/** The name of the database for WordPress */
define('DB_NAME', 'example');
/** MySQL database username */
define('DB_USER', 'example');
/** Dev Server Creds */
define('DB_PASSWORD', 'password');
@trevor-atlas
trevor-atlas / d_install.sh
Last active August 29, 2015 14:01
clone drupal install.sh
#!/bin/sh
# Gets our drupal install rolling.
# place this in /usr/bin and chmod +x to make it usable globally.
# example use would be to create a site in virtualmin, cd to the root directory of the site and type "d_install"
if [ -e $1 ];
then
echo -e "\e[31mERROR: please supply site password\e[0m"
exit 1
@trevor-atlas
trevor-atlas / WP automatic updates
Last active August 29, 2015 14:01
enable automatic Wordpress updates
wordpress/wp-config.php
Paste the following code to your wp-config.php file, preferably just below every other line of code.
define('FS_METHOD','direct');
#!/bin/sh
# This is usually run by the d_install script (https://gist.github.com/treall/240b8408cd944c17551a)
# This script will:
# make sure you're in the correct directory,
# download the latest drupal 7 release,
# install our frequently used modules,
# setup the admin account,
# create an Aurora subtheme,
# update the .htaccess file for use on our outdated dev server,
@trevor-atlas
trevor-atlas / cover.css
Created November 26, 2013 17:39
full page background images
.cover {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}