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 | |
function avia_woocommerce_enabled() | |
{ | |
if (defined("WOOCOMMERCE_VERSION")) { return true; } | |
return false; | |
} | |
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 showrecentcomments(json){ | |
for(var i=0;i<a_rc;i++){ | |
var b_rc=json.feed.entry[i];var c_rc;if(i==json.feed.entry.length)break;for(var k=0;k<b_rc.link.length;k++){if(b_rc.link[k].rel=='alternate'){c_rc=b_rc.link[k].href;break;}}c_rc=c_rc.replace("#","#");var d_rc=c_rc.split("#");d_rc=d_rc[0];var e_rc=d_rc.split("/");e_rc=e_rc[5];e_rc=e_rc.split(".html");e_rc=e_rc[0];var f_rc=e_rc.replace(/-/g," ");f_rc=f_rc.link(d_rc);var g_rc=b_rc.published.$t;var h_rc=g_rc.substring(0,4);var i_rc=g_rc.substring(5,7);var j_rc=g_rc.substring(8,10);var k_rc=new Array();k_rc[1]="Jan";k_rc[2]="Feb";k_rc[3]="Mar";k_rc[4]="Apr";k_rc[5]="May";k_rc[6]="Jun";k_rc[7]="Jul";k_rc[8]="Aug";k_rc[9]="Sep";k_rc[10]="Oct";k_rc[11]="Nov";k_rc[12]="Dec";if("content" in b_rc){var l_rc=b_rc.content.$t;}else if("summary" in b_rc){var l_rc=b_rc.summary.$t;}else var l_rc="";var re=/<\S[^>]*>/g;l_rc=l_rc.replace(re,"");document.write('<div class="rcw-comments">');if(m_rc==true)document.write('On '+k_rc[parseInt(i_rc,10)]+' '+j_rc+' ');document. |
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
sudo apt-get clean | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get upgrade git |
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
# Check requirement | |
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production | |
# Check everything is working | |
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production | |
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production | |
# Troubleshot: Commit / Merge Request Error # | |
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
you can use such conditions to show private posts only to logged in users with role contributor. Now you only need to make post private to make that post available for contributor. | |
Ref: http://wordpress.stackexchange.com/questions/60582/limit-access-to-posts-pages-by-user-roles | |
<?php | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
$private = get_post_custom_values("private"); | |
if (isset($private[0]) && $private == "true") { | |
if ( current_user_can( 'contributor' ) ) { //passing role to it may sometime not work | |
the_title(); |
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
Ref: http://albertolarripa.com/2013/07/10/megatools-synchronizing-your-backups-to-mega/ | |
#!/bin/sh | |
MEGASYNC='/usr/local/bin/megasync' | |
MEGARM='/usr/local/bin/megarm' | |
LOCALDIR="/usr/local/data/backups" | |
REMOTEDIR="/Root/albertolarripa/backups" | |
SEDLOCALDIR="\/usr\/local\/data\/backups" | |
SEDREMOTEDIR="\/Root\/albertolarripa\/backups" |
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 | |
/** | |
* BoxBilling | |
* | |
* LICENSE | |
* | |
* This source file is subject to the license that is bundled | |
* with this package in the file LICENSE.txt | |
* It is also available through the world-wide-web at this URL: | |
* http://www.boxbilling.com/LICENSE.txt |
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 | |
# (c) 2013 - MasEdi (http://masedi.net/) | |
yum groupinstall "Development tools" | |
yum install zlib-devel | |
yum install bzip2-devel openssl-devel ncurses-devel automake make | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 | |
tar zxf Python-2.7.3.tar.bz2 | |
cd Python-2.7.3 | |
./configure --prefix=/usr/local |
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
/* | |
* Display Image from the_post_thumbnail or the first image of a post else display a default Image | |
* Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters. | |
* USAGE: <?php echo my_image_display(); ?> | |
*/ | |
function my_image_display($size = 'full') { | |
if (has_post_thumbnail()) { | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id, $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
closure to generate hashed filename for Phalcon template compiled path kind of file: | |
```php | |
<?php | |
$volt->setOptions(array( | |
'compiledPath' => function($templatePath) { | |
return md5($templatePath) . '.php'; | |
} | |
)); |
OlderNewer