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
<?php | |
/** | |
* Add paragraph breaks to plain text notifications sent by Mandrill | |
* | |
* Mandrill's default option for handling this is a bit too | |
* agressive. This method checks the type of email, and attempts | |
* to detect whether or not it is HTML or not. | |
* | |
* @param array $message |
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
<div class="row equal-height"> | |
<div class="hidden-xs equal-height-trigger"></div> | |
<div class="col-sm-6 col-md-3"> | |
<div class="card"> | |
<div class="inner"> | |
<header> | |
<h3>Lorem</h3> | |
</header> | |
<p>Lorem ipsum Veniam eiusmod sunt velit deserunt ullamco cillum Duis dolore anim nulla Ut pariatur pariatur labore non esse qui proident ad.</p> |
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
$(document).on('click', 'a[href*=#]', function(event){ | |
event.preventDefault(); | |
var targetId = this.hash; | |
var theTarget = $(targetId); | |
var customOffset = 0; | |
switch( targetId ){ | |
case '#target1': | |
case '#target2': | |
customOffset = -80; |
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
find . -type f -name "file-pattern*" -exec sh -c 'echo mv "$0" "${0/find/replace}"' '{}' \; | |
#Remove the echo when you're sure this does what you want. |
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
function openPopup(href, title, width, height){ | |
var left = screen.availLeft + screen.width/2 - width/2, | |
top = screen.height/2 - height/2; | |
window.open(href, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left); | |
}; |
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
<?php | |
/** | |
* Parse an ISO 8601 duration string | |
* @return array | |
* @param string $str | |
**/ | |
function parseDuration($str) | |
{ | |
$result = array(); | |
preg_match('/^(?:P)([^T]*)(?:T)?(.*)?$/', trim($str), $sections); |
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
@mixin gallery-items($size) { | |
.item { | |
float: left; | |
.thumbnail { | |
margin-bottom: $size/4; | |
text-align: center; | |
width: $size; | |
height: $size; |
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
# Update wp_options table | |
UPDATE wp_options SET option_value = REPLACE(option_value,'example.com','example.dev'); | |
# Update wp_posts table | |
UPDATE wp_posts SET guid = REPLACE(guid,'example.com','example.dev'); |
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
# Table Prefix | |
SET @prefix = 'wp'; | |
# Find and replace strings | |
SET @find = "www.example.com"; | |
SET @replace = "www.example.dev"; | |
# Build and execute the statements | |
SET @sql1 = CONCAT('UPDATE ', @prefix, '_options SET option_value = REPLACE(option_value,?,?)'); | |
SET @sql2 = CONCAT('UPDATE ', @prefix, '_posts SET guid = REPLACE(guid,?,?)'); |
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
# Find listening port 22 on the network | |
nmap -T5 -n -p 22 --open --min-parallelism 100 192.168.0.0/24 | |
# edit hostname and hosts to change the hostname. | |
sudo nano /etc/hostname | |
sudo nano /etc/hosts | |
# edit the static IP address in the interfaces file. | |
sudo nano /etc/network/interfaces |