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
DROP TABLE IF EXISTS time_dimension; | |
CREATE TABLE time_dimension ( | |
id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
db_date DATE NOT NULL, | |
year INTEGER NOT NULL, | |
month INTEGER NOT NULL, -- 1 to 12 | |
day INTEGER NOT NULL, -- 1 to 31 | |
quarter INTEGER NOT NULL, -- 1 to 4 | |
week INTEGER NOT NULL, -- 1 to 52/53 | |
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'... |
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 | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - 2012-2018 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit', '1024M'); |
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 arr = { | |
max: function(array) { | |
return Math.max.apply(null, array); | |
}, | |
min: function(array) { | |
return Math.min.apply(null, array); | |
}, | |
range: function(array) { |
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
1. Open "my.ini" in "C:\xampp\mysql\bin\" directory. | |
2. Edit the following lines. | |
# Add the following code before [client]. | |
default-character-set=utf8 | |
# Add the following code before [mysqld]. | |
character-set-server=utf8 | |
skip-character-set-client-handshake |
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 | |
return array ( | |
'(UTC-11:00) Midway Island' => 'Pacific/Midway', | |
'(UTC-11:00) Samoa' => 'Pacific/Samoa', | |
'(UTC-10:00) Hawaii' => 'Pacific/Honolulu', | |
'(UTC-09:00) Alaska' => 'US/Alaska', | |
'(UTC-08:00) Pacific Time (US & Canada)' => 'America/Los_Angeles', | |
'(UTC-08:00) Tijuana' => 'America/Tijuana', | |
'(UTC-07:00) Arizona' => 'US/Arizona', |
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
// If you want inserted images in a CKEditor to be responsive | |
// you can use the following code. It creates a htmlfilter for the | |
// image tag that replaces inline "width" and "style" definitions with | |
// their corresponding attributes and add's (in this example) the | |
// Bootstrap "img-responsive" class. | |
CKEDITOR.on('instanceReady', function (ev) { | |
ev.editor.dataProcessor.htmlFilter.addRules( { | |
elements : { | |
img: function( el ) { | |
// Add bootstrap "img-responsive" class to each inserted image |
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 | |
/** | |
* StatusCodes provides named constants for | |
* HTTP protocol status codes. Written for the | |
* Recess Framework (http://www.recessframework.com/) | |
* | |
* @author Kris Jordan | |
* @license MIT | |
* @package recess.http | |
* |
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
1. Make Home Directory for SShH keys. | |
c://users/UserName/.SSH (for Windows 7) | |
2. Generate SSH key by command: | |
ssh-keygen -t rsa -C "[email protected]" | |
# Creates a new ssh key, using the provided email as a label | |
Generating public/private rsa key pair. | |
It's created a pair of keys - private and public in home dir .SSH | |
C:\Users\SuvorovAG\.ssh\id_rsa |
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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$database = 'db'; | |
$user = 'user'; | |
$pass = 'pass'; | |
$host = 'localhost'; |
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
Artisan | |
// Displays help for a given command | |
php artisan --help OR -h | |
// Do not output any message | |
php artisan --quiet OR -q | |
// Display this application version | |
php artisan --version OR -V | |
// Do not ask any interactive question | |
php artisan --no-interaction OR -n | |
// Force ANSI output |
OlderNewer