Skip to content

Instantly share code, notes, and snippets.

@waako
waako / images.md
Last active December 18, 2015 20:39
Brand image sizes for the web

Icons

16x16px Favicon base
24x24px Pinned site in IE9
29x29 iOS Settings icon (non-Retina)
32x32px New tab page in IE, Windows 7+ tasbar and Safari’s ‘Read Later’ sidebar
50x50px iOS Spotlight result icon (non-Retina)
57x57px iOS home screen icon (iPod Touch, iPhone to 3G)
58x58px iOS Settings icon (Retina)
72x72px iPad home screen icon (iPad 1 & 2)

@waako
waako / Error
Last active December 20, 2015 10:38
MySQL has gone away error
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Users/waako/Dropbox/Sites/Contract/Tag1/ArchetypeMe/code/archetypeme/includes/database/database.inc:2139
Stack trace:
#0 /Users/waako/Dropbox/Sites/Contract/Tag1/ArchetypeMe/code/archetypeme/includes/database/database.inc(2139): PDOStatement->execute(Array)
#1 /includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)
#2 /includes/database/database.inc(2318): DatabaseConnection->query('SELECT expire, ...', Array, Array)
#3 /includes/lock.inc(167): db_query('SELECT expire, ...', Array)
#4 /includes/lock.inc(146): lock_may_be_available('theme_registry:...')
#5 /includes/database/database.inc on line 2139
@waako
waako / vagrant-packaging.sh
Created August 27, 2013 18:13
cleaning up vagrant box before packaging
guest$ vagrant ssh
vagrant$ sudo su
# Total upgrade
apt-get update && apt-get upgrade
apt-get dist-upgrade
# Ensure the box is minimally provisioned
apt-get -q -y install puppet zerofree
@waako
waako / info.md
Last active December 21, 2015 22:49
Problems building Open Atrium site on Vagrant box

Steps to reproduce problems:

$ git clone https://github.com/cyberswat/drupal-lamp/

Update .drupal_lamp.json to be:

{
background: rgba(255,255,255,1);
background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 50%, rgba(255,255,255,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(255,255,255,1)), color-stop(50%, rgba(230,230,230,1)), color-stop(100%, rgba(255,255,255,1)));
background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 50%, rgba(255,255,255,1) 100%);
background: -o-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 50%, rgba(255,255,255,1) 100%);
background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 50%, rgba(255,255,255,1) 100%);
background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 50%, rgba(255,255,255,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff', GradientType=1 );
@waako
waako / gist:6606788
Last active December 23, 2015 08:19
bulk update user passwords via drush and a variable
# This should change the passwords for user1, user2 and user3 and set it to password
for i in user1 user2 user3; do drush upwd $i --password="password"; done
# If you need to find out all the usernames from a sequence of UIDs
for i in `seq 2 20`; do drush upwd $i; done
@waako
waako / gist:6855911
Last active December 24, 2015 20:09
Basics to getting Vagrant running on Ubuntu

source: http://swaeku.github.io/blog/2013/03/09/installing-vagrant-on-ubuntu-12-dot-10/

Why Reproductibe Environments are Essentials

Without a reproductible environment that can be setup rapidly, testing installation or deployment scripts almost always ends up in breaking my working environment and makes me less efficient.

Install Virtualbox

Virtualbox is the virtualization software used by Vagrant:

@waako
waako / site.pp
Last active December 25, 2015 12:09
nginx puppet alias directory
nginx::resource::vhost { 'test.dev':
ensure => present,
server_name => [
'test.dev' ],
listen_port => 80,
index_files => [
'index.html',
'index.htm',
'index.php'
],
@waako
waako / penguins
Created December 20, 2013 12:14
Dead Penguins
Did you ever wonder why there are no dead penguins on the ice in Antarctica ?
Where do they go?
Wonder no more ! ! !
It is a known fact that the penguin is a very ritualistic bird which lives an extremely
ordered and complex life.The penguin is very committed to its family and will mate for life,
as well as maintain a form of compassionate contact with its offspring throughout its life.
jQuery(document).ready(function($) {
var $menu_item = jQuery(".menu-products-taxonomy > ul > li");
for (var i = 0; i < $menu_item.length; i += 7) {
var $div = $("<div/>", {
class: 'col-md-6'
});
$menu_item.slice(i, i + 7).wrapAll($div);
}
});