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
var db = openDatabase('myDatabase', '', 'My database description', 5 * 1024 * 1024); | |
if (reinitDb) { | |
db.changeVersion(db.version, '', function(t) { | |
t.executeSql("SELECT name FROM sqlite_master WHERE type='table' and name not like '__Webkit%'", [], function(sqlTransaction, sqlResultSet) { | |
var table, tablesNumber = sqlResultSet.rows.length; | |
console.log('DATABASE RESET MODE ENABLED'); | |
for (var i = 0; i < tablesNumber; i++) { | |
table = sqlResultSet.rows.item(i); | |
console.log('Removing table: ' + table.name); |
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
.remark-fading { | |
z-index: 9; | |
} | |
.remark-slide-container { | |
transition: opacity 1s linear, right 1s ease-in-out; | |
opacity: 0; | |
right: 1000px; | |
} | |
.remark-visible { | |
transition: opacity 1s linear, right 1s ease-in-out; |
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
# <virtualhost *:80> already open | |
RewriteEngine on | |
ReWriteCond %{SERVER_PORT} !^443$ | |
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | |
</virtualhost> | |
<VirtualHost *:443> | |
ServerAdmin zadmin@localhost | |
DocumentRoot "/etc/sentora/panel/" | |
ServerName your-server-address |
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
# git prompt, for ~/.bashrc | |
GIT_PROMPT_ONLY_IN_REPO=1 | |
GIT_PROMPT_START_USER="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]" | |
GIT_PROMPT_START_ROOT="${BoldRed}\u@\h${ResetColor}:${BoldBlue}\w${ResetColor}" | |
GIT_PROMPT_END_USER="\n$ " | |
GIT_PROMPT_END_ROOT="\n# " | |
source ~/.bash-git-prompt/gitprompt.sh |
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
ll=ls -l --color $* | |
phpdoc=php "C:\Program Files\phpDocumentor\bin\phpdoc.php" | |
vi=vim $* | |
md2html=markdown-html -s "~\Documents\md.css" -w $1 -o $1.html | |
composer=php "~\Documents\composer.phar" $* |
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 | |
/** | |
* Disable local delivery when a minimum amount is not reached. | |
* The minimum amount is the free shipping one. | |
*/ | |
function setMinimumAmountForLocalDelivery($isAvailable) { | |
// get cart amount : | |
if (WC()->cart->prices_include_tax) { | |
$cartAmount = WC()->cart->cart_contents_total + array_sum(WC()->cart->taxes); | |
} else { |
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
/* This CSS is for markdown-html */ | |
/* markdown-html -s "/path/to/markdown.css" -w "file.md" -o "file.html" */ | |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
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 | |
/* Custom gallery output */ | |
function customGalleryOutput($output = "", $attr) { | |
// This part is globally copied from the WordPress gallery function | |
$return = $output; // fallback | |
$post = get_post(); | |
if ( ! empty( $attr['ids'] ) ) { | |
// 'ids' is explicitly ordered, unless you specify otherwise. | |
if ( empty( $attr['orderby'] ) ) |
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 bootstrap, in order to be able to use its carousel feature | |
function enqueueStyles() { | |
wp_enqueue_style("bootstrap", get_stylesheet_directory_uri() . "/css/bootstrap/css/bootstrap.min.css"); | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script('bootstrap-js', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', 'jquery' ); | |
} | |
add_action("wp_enqueue_scripts", "enqueueStyles"); |
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 | |
/** | |
* Shift code to the left, preserving indentation. | |
* | |
* This is useful when reading code extract in a not-displayed nested structures. | |
* There is no use of closure here in order to remain compatible with older versions of PHP. | |
* This method is code agnostic. | |
* @example | |
* $code = ""; | |
* $code .= " while ($a) {"; |
NewerOlder