This file contains hidden or 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 | |
/** | |
* Get the excerpt of a paragraph or string of long text. | |
* | |
* Get the shortened version of text for the wyisiwig. Use with custom wysiwyg (e.g. Advanced Custom Fields). This will print the paragraph and breaks tag but will strip all other tags | |
* | |
* @since 2014-11-06 | |
* @version 2016-03-09 | |
* @author De'Yonte W.<[email protected]> |
This file contains hidden or 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
mysqldump -u db_user -p db_password -h db_host --add-drop-table --no-data db_name | grep ^DROP | mysql -u db_user -p db_password -h db_host db_name |
This file contains hidden or 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
SELECT disqus_forum_users.forum_id, COUNT(disqus_forum_users.forum_id) AS `count`, disqus_forums.description, website FROM disqus_forum_users LEFT JOIN disqus_forums ON disqus_forums.forum_id = disqus_forum_users.forum_id WHERE disqus_forum_users.forum_id != "dailyreckoning" GROUP BY forum_id ORDER BY count DESC; |
This file contains hidden or 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 | |
/* | |
Output a list of numbers multiple times depending on their value (e.g. output 9 nine times, or 18 eighteen times). Works well if it doesn't matter if you listall the numbers preceding the last number | |
*/ | |
$array = array(1,2,3,4,5,6,7,8,9,12,18); | |
foreach ($array as $num) { | |
$string = ''; | |
$count = 1 * $num; | |
for ($i=0;$i < $count; $i++) { |
This file contains hidden or 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
# http://nicolasleroy.be/blog/vagrant-error | |
vagrant halt // As the machine will have booted, even with the error above | |
rm -rf /etc/exports // Remove the exports file. | |
vagrant up // Let's try again, fingers crossed |
This file contains hidden or 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
// sort the table after window object is done loading | |
jQuery(window).ready(function($){ | |
var $ = jQuery; | |
// sort Portfolio table by the portfolio group | |
sort_portfolio_group(); | |
}); | |
// sort the portfolio by group and by the selected sorting order | |
function sort_portfolio_group(){ | |
var $ = jQuery; |
This file contains hidden or 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
{ | |
// The tab key will cycle through the settings when first created | |
// Visit http://wbond.net/sublime_packages/sftp/settings for help | |
// sftp, ftp or ftps | |
"type": "sftp", | |
"save_before_upload": true, | |
"upload_on_save": true, | |
"sync_down_on_open": true, |
This file contains hidden or 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
public function slipstream_ad_content($content) | |
{ | |
if(!is_single() || get_post_type() == 'lp' || get_post_type() == 'got') | |
return $content; | |
global $agora_core, $dr_theme, $afp_openx; | |
$openx_script = (is_object($afp_openx)) ? $afp_openx->openx_script(array('zoneid' => $dr_theme->openx_635x120_zoneid)) : ''; | |
$paragraphs = str_replace('</p>', '', $content); |
This file contains hidden or 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
wp db query "UPDATE wp_users SET user_pass=MD5('new_password_here') WHERE user_login='username'" |
This file contains hidden or 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
$media-query-mixin-warning: "You should be using the Breakpoint SASS mixin library or the Susy Grid mixin to take advantage of cool features. Your media query will still compile though" | |
=phone-only | |
+phone("down") | |
@content | |
=tablet-only | |
+tablet("only") | |
@content |