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 ActiveRecord extends CActiveRecord | |
{ | |
public static function model($className = null) | |
{ | |
return parent::model($className ? : get_called_class()); | |
} |
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
(function() { | |
Backbone.Model.prototype._save = Backbone.Model.prototype.save; | |
Backbone.Model.prototype.save = function (attrs, options) { | |
var that = this; | |
if (!options) { | |
options = {}; | |
} | |
if (this.savingNewRecord) { | |
// store or replace last PUT request with the latest version, we can safely replace old PUT requests with new ones | |
// but if there are callbacks from a previous PUT request, we need to make sure they are all called as well |
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 SetRoleCommand extends CConsoleCommand | |
{ | |
public function actionIndex($role, $userId) | |
{ | |
$auth = Yii::app()->authManager; | |
$roles = $auth->getRoles(); | |
if (!array_key_exists($role, $roles)) { | |
$auth->createRole($role); |
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
.hover-info { | |
$pd: 20px; // Padding | |
$bd: 1px; // Border width | |
$bdr: 8px; // Border radius | |
$bdc: rgba(0, 0, 0, 0.1); // Border color | |
$bsh: 2px 2px 2px rgba(0, 0, 0, 0.2); // Box shadow | |
.hover-details { | |
display: none; | |
} |
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
$db = $this->getContext()->getDB(); | |
$dbConf = $this->getContext()->getConf()->database; | |
$dbh = new PDO("mysql:host=$dbConf->host;dbname=$dbConf->database", $dbConf->username, $dbConf->password); | |
$sql = "update runresults set report_html = :report where id = :id"; | |
$q = $dbh->prepare($sql); | |
$q->execute(array( | |
':report'=>gzencode('hello'), | |
':id'=> 1052 | |
)); |
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
define([ | |
'jasmine' | |
], function() { | |
describe('Simple Test', function() { | |
var view, context = {}; | |
beforeEach(function() { | |
view = 1; | |
context.view = view; | |
}); |
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
{ | |
"repositories" : [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "yiisoft/yii2", | |
"version": "master", | |
"source": { | |
"type": "git", | |
"url": "https://github.com/yiisoft/yii2.git", |
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
# for more information look at help.github.com/capistrano/ | |
set :application, "yii2-app-basic" | |
server "example.com", :web # your server address or IP | |
set :user, "username" # your username for ssh | |
set :use_sudo, false | |
# set the remote directory you're going to deploy to | |
set :deploy_to, "/home/#{user}/www/#{application}" | |
# disable rails specific normalize_assets property |
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
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script src="//code.highcharts.com/highcharts.js"></script> | |
<script> | |
var chart, el; | |
window.onload = function() { | |
el = document.getElementById('chart'); | |
}; |
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
angular.module('testQDecorator', []) | |
.config(function($provide) { | |
$provide.decorator('$q', function($delegate) { | |
function decoratePromise(promise) { | |
promise.resolved = false; | |
promise.finally(function() { | |
promise.resolved = true; | |
}); | |
return promise; | |
} |
OlderNewer