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
| /* update database after modification of $table_prefix = 'wp_'; in wp-config.php */ | |
| /* see : http://stackoverflow.com/questions/13815461/you-do-not-have-sufficient-permissions-to-access-this-page-without-any-change */ | |
| UPDATE `{%TABLE_PREFIX%}usermeta` SET `meta_key` = replace(`meta_key`, '{%OLD_TABLE_PREFIX%}', '{%NEW_TABLE_PREFIX%}'); | |
| UPDATE `{%TABLE_PREFIX%}options` SET `option_name` = replace(`option_name`, '{%OLD_TABLE_PREFIX%}', '{%NEW_TABLE_PREFIX%}'); | |
| /**/ |
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
| // do something if window size change | |
| jQuery(window).resize(function() { | |
| "use strict"; | |
| if(jQuery(window).height() < 500) { | |
| console.log('do something'); | |
| }else{ | |
| console.log('do something else'); | |
| } | |
| }); |
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 checkEmptyInput(idInput ,defaultvalue) { | |
| "use strict"; | |
| jQuery("#"+idInput).focus(function(){ | |
| if (defaultvalue === jQuery("#"+idInput).val()) { | |
| jQuery(this).val(''); | |
| } // END IF | |
| }); | |
| // FOCUSOUT INPUT | |
| jQuery("#"+idInput).blur(function(){ | |
| if (jQuery("#"+idInput).val() === '') { |
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
| // delay redirect | |
| function delayer(){ | |
| "use strict"; | |
| window.location = "https://gist.github.com/davask/"; | |
| } | |
| jQuery(document).ready(function(){ | |
| "use strict"; | |
| setTimeout('delayer();', 10000); | |
| }); |
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 checkForSubmit(o, fields) { | |
| "use strict"; | |
| var submit = true; | |
| var form = o.parents('form:eq(0)'); | |
| form.submit(function() { | |
| if (typeof fields !== 'undefined') { | |
| if (typeof fields.input !== 'undefined') { | |
| if (typeof fields.input.text !== 'undefined') { | |
| var text = fields.input.text; | |
| for (var i = 0, len = text.length; i < len; ++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
| var j = jQuery.noConflict(); | |
| // Do something with jQuery | |
| j("div p").hide(); | |
| // Do something with another library's $() | |
| $("content").style.display = 'none'; |
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
| jQuery('body').prepend('<div style="background:#BADA55;color:#ff0000;height:25px;text-align: center;">top moumoute</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
| <?php | |
| /* see: http://www.php.net/manual/en/class.ziparchive.php#110719 */ | |
| class HZip | |
| { | |
| /** | |
| * Add files and sub-directories in a folder to zip file. | |
| * @param string $folder | |
| * @param ZipArchive $zipFile | |
| * @param int $exclusiveLength Number of text to be exclusived from the file path. | |
| */ |
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 | |
| /* BACKUP a file | |
| * HZip.class.php | |
| * see: https://gist.github.com/davask/5035745 | |
| */ | |
| include(__DIR__.'/HZip.class.php'); | |
| HZip::zipDir('pathToSourceFolder', 'pathToZipFile'); | |
| ?> |
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
| # Virtual Hosts configuration on xampp | |
| # see : http://www.tildemark.com/setting-up-virtual-hosts-with-xampp-running-on-windows-xp/ | |
| # add your domain name in F:\Windows\System32\drivers\etc\hosts like | |
| # 127.0.0.1 sub.domain.tld | |
| # see : http://httpd.apache.org/docs/2.2/vhosts/ | |
| # NameVirtualHost *:80 useless |