This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab and run MariaDB image | |
docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=db -d mariadb:latest | |
# Restore a dump into the DB | |
docker exec -i mariadb mysql -uroot -psecret --database=db < dump.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Assumes AWS CLI installed and configured with default region. | |
# To query an alternate region add the --region parameter, e.g. | |
# --region us-west-2 | |
aws ec2 describe-images \ | |
--owners amazon \ | |
--filters "Name=name,Values=amzn-ami-hvm*ebs" \ | |
--query 'sort_by(Images,&CreationDate)[-1].ImageId' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Configure homebrew permissions to allow multiple users on MAC OSX. | |
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine. | |
# allow admins to manage homebrew's local install directory | |
chgrp -R admin /usr/local | |
chmod -R g+w /usr/local | |
# allow admins to homebrew's local cache of formulae and source files | |
chgrp -R admin /Library/Caches/Homebrew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define (['knockout', 'jquery', 'prettyDate', 'metrojs'], function ( ko, $ ) { | |
"use strict"; | |
// See https://github.com/SteveSanderson/knockout/wiki/Bindings---class | |
ko.bindingHandlers['class'] = { | |
'update' : function ( element, valueAccessor ) { | |
if ( element['__ko__previousClassValue__'] ) { | |
ko.utils.toggleDomNodeCssClass (element, element['__ko__previousClassValue__'], false); | |
} | |
var value = ko.utils.unwrapObservable (valueAccessor ()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define (['knockout', 'jquery', 'prettyDate', 'metrojs'], function ( ko, $ ) { | |
"use strict"; | |
// See https://github.com/SteveSanderson/knockout/wiki/Bindings---class | |
ko.bindingHandlers['class'] = { | |
'update' : function ( element, valueAccessor ) { | |
if ( element['__ko__previousClassValue__'] ) { | |
ko.utils.toggleDomNodeCssClass (element, element['__ko__previousClassValue__'], false); | |
} | |
var value = ko.utils.unwrapObservable (valueAccessor ()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Edit themes functions.php. Right after initial <?php line place the following: | |
update_option('siteurl','http://example.com/blog'); | |
update_option('home','http://example.com/blog'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic Random Image Rotator | |
// jQuery required http://jquery.com | |
// Easy option | |
// img is an array of images | |
var img = ['img1.jpg','img2.jpg','img3.jpg','img4.jpg']; | |
// src="images/rotator/ is path to your files contained in above array | |
$('<img src="images/rotator/' + images[Math.floor(Math.random() * images.length)] + '">').appendTo('#imageContainer'); | |
//////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selector { | |
opacity: .75; /* Standard: FF gt 1.5, Opera, Safari */ | |
filter: alpha(opacity=75); /* IE lt 8 */ | |
-ms-filter: "alpha(opacity=75)"; /* IE 8 */ | |
-khtml-opacity: .75; /* Safari 1.x */ | |
-moz-opacity: .75; /* FF lt 1.5, Netscape */ | |
} | |
/* Source: http://snipplr.com/view/10094/crossbrowser-opacity/ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?x) | |
\b | |
( # Capture 1: entire matched URL | |
(?: | |
[\w-]+: # URL protocol and colon | |
(?: | |
/{1,3} # 1-3 slashes | |
| # or | |
[[:alpha:][:digit:]] # Single letter or digit | |
# (Try not to match, say "URI::Escape") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming use of http://code.google.com/p/twitterjs/ for publishing to your website, and | |
// http://apps.facebook.com/selectivetwitter/ for publishing to Facebook | |
function fbRemove() { | |
$('#tweet li').each(function() { | |
var el = $(this); | |
el.html(el.html().replace(/\s*#.*fb<\/a>/ig, '')); | |
}); | |
} |
NewerOlder