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
from random import randint | |
import kafka | |
from kafka import KafkaConsumer | |
BOOTSTRAP_SERVERS = '127.0.0.1:9092' | |
topic_name = 'test_topic' + str(randint(0, pow(10, 10))) | |
print(topic_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
'use strict'; | |
angular.module('testQDecorator', []) | |
.config(function($provide) { | |
$provide.decorator('$q', function($delegate) { | |
function decoratePromise(promise) { | |
var then = promise.then; | |
promise.resolved = false; | |
promise.finally(function() { | |
promise.resolved = true; |
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; | |
} |
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
# 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
{ | |
"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
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
$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
.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
<?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); |
NewerOlder