- Session:
- Removed register_globals related code and "!" can be used as $_SESSION key name.
- Session is made to manage session status correctly and prevents invalid operations.
Only inappropriate codes are affected by this change. If you have problems with this,
it means you have problem in your code.
- Functions are made to set or return correct session status. session_start(), session_status(), session_regenerate_id()
- Functions are made to return bool from null. These functions have void parameter
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 | |
$arr = array(); | |
$arr[0]['derp'] = 'hi'; | |
$arr[0]['blerg'] = 'hey'; | |
produceCSV('data.csv', $arr); | |
function produceCSV($file_name, $arr) { |
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 that = this; | |
this.myForm = this.FormBuilder.group({ | |
username: ["", this.Validators.required], | |
password: ["", this.Validators.required], | |
bio: ["", this.Validators.required], | |
}); | |
this.create = function() { | |
console.log("VALUES", that.myForm.valid, that.myForm.value); |
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
window.addEventListener("orientationchange", function() { | |
alert(window.orientation); | |
//do whatever you want on orientation change here | |
}, 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
Установить Docker CE и docker-compose на систему, если у вас MacOS или Windows | |
вы можете скачать установщик с офф. сайта | |
https://www.docker.com/get-started | |
Если же у вас Linux проводим установку как указано здесь: | |
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce | |
Далее устанавливаем docker-compose | |
https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-16-04 |
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
APP_ENV=local | |
APP_DEBUG=true | |
APP_KEY=base64:hyHUpukUUigKeEsxpGeTW4UZ+Lg+WAWxcc4/BjlgNtE= | |
APP_URL=http://localhost | |
DB_CONNECTION=pgsql | |
DB_HOST=hostname | |
DB_PORT=5432 | |
DB_DATABASE=Your database name | |
DB_USERNAME=Your database username |
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
// http://stackoverflow.com/a/5727346/3774582 | |
// Parse CRON frequency | |
// Break it down like James Brown | |
function parse_crontab($time, $crontab) { | |
// Get current minute, hour, day, month, weekday | |
$time = explode(' ', date('i G j n w', strtotime($time))); | |
// Split crontab by space | |
$crontab = explode(' ', $crontab); | |
// Foreach part of crontab | |
foreach ($crontab as $k => &$v) { |
- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
- edit /etc/redis-xxx.conf, illustrated as below
...
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 | |
class BaseModel extends Eloquent { | |
public static function isJoined($query, $table) | |
{ | |
$joins = $query->getQuery()->joins; | |
if($joins == null) { | |
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
'use strict'; | |
var gulp = require('gulp'), | |
watch = require('gulp-watch'), | |
prefixer = require('gulp-autoprefixer'), | |
uglify = require('gulp-uglify'), | |
sass = require('gulp-sass'), | |
sourcemaps = require('gulp-sourcemaps'), | |
rigger = require('gulp-rigger'), | |
cssmin = require('gulp-minify-css'), |
OlderNewer