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 | |
/** | |
* Components are tightly connected (or appears so) to the controllers | |
* and as the application grows bigger, some of the work is done other places | |
* like event listener classes, mailers, shell commands, custom project classes etc. | |
* When that happens this can lead to code duplication from your components to those places. | |
* | |
* On a CakePHP project we are working on we starting using a structure called Features (idea taken | |
* from a Laravel community), where we have a "Feature Runner" trait, and a feature class structure which | |
* only includes a constructor and handle public methods and run as in example. By adding use FeatureRunner to any class |
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|=|xml))(\s|\t|\n) |
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 | |
/** | |
* This script attempts to add namespace Processwire to every .php and .module file in the given directory. | |
* It worked fine for my project but I cannot guarantee for you, so PLEASE take a backup or two before you | |
* attempt to try it. | |
* | |
* To use it put this in your root folder and navigate with your browser to the file like | |
* example.com/processwire-3-namespace-migrator.php | |
* Also you should disable the compiler by setting $config->templateCompile=false; in your /site/config.php. | |
* |
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
body { | |
background-color: #ddd; | |
} | |
#entry-list>li { | |
position: relative; | |
padding: 30px 20px; | |
background:#f3f3f3; | |
margin:10px 0; | |
font-size:18px; | |
border:1px solid #ccc; |
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
.htaccess | |
wp-config.php | |
wp-content/uploads/ | |
wp-cli.yml | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/backupwordpress* | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php |
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
function wp_bootstrap_pagination( $wp_query = false ) { | |
if($wp_query == false) { | |
global $wp_query; | |
} | |
$big = 999999999; | |
$pages = paginate_links(array( | |
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), | |
'format' => '?page=%#%', | |
'current' => max(1, get_query_var('paged')), |
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
<div class="entry__arrows visible-md visible-lg"> | |
<a class="entry__arrow entry__arrow--prev" href="<?=get_permalink(get_adjacent_post(false,'',false));?>"></a> | |
<a class="entry__arrow entry__arrow--next" href="<?=get_permalink(get_adjacent_post(false,'',true));?>"></a> | |
</div> |
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
BootstrapModalControl = { | |
init : function(){ | |
//for necessary binding | |
}, | |
modelBox : function(){ | |
//this could be dynamic if you have more than one modal | |
return $('#admin-modal'); | |
}, |
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
//source: http://stackoverflow.com/questions/1850232/turkish-case-conversion-in-javascript | |
String.prototype.turkishToUpper = function(){ | |
var string = this; | |
var letters = { "i": "İ", "ş": "Ş", "ğ": "Ğ", "ü": "Ü", "ö": "Ö", "ç": "Ç", "ı": "I" }; | |
string = string.replace(/(([iışğüçö]))+/g, function(letter){ return letters[letter]; }) | |
return string.toUpperCase(); | |
} | |
String.prototype.turkishToLower = function(){ |
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
git rm -r --cached . | |
git add --all | |
git commit -am 'git cache cleared' |