This file contains hidden or 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 | |
// original work: https://github.com/fishjerky/phalcon-mssql | |
// modified by Davide Airaghi (www.airaghi.net) to use with SQL Server 2008 and Microsoft SQL Server PDO driver | |
// version: 0.1 | |
namespace Twm\Db\Adapter\Pdo; | |
use Phalcon; | |
use Phalcon\Db\Column; |
This file contains hidden or 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 app = require('express')(), | |
swig = require('swig'), | |
async = require("async"), | |
sleep = require('sleep'), | |
people; | |
// This is where all the magic happens! | |
app.engine('html', swig.renderFile); |
This file contains hidden or 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 sleep = require('sleep'); | |
var Promise = require('promise'); | |
function random (low, high) { | |
return Math.random() * (high - low) + low; | |
} | |
var task1 = new Promise(function (resolve, reject) { | |
var until = 900;//random(900,1000); | |
setTimeout(function(){ |
This file contains hidden or 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 | |
namespace app\models; | |
use Yii; | |
use yii\db\Expression; | |
/** | |
* This is the model class for table "modelA". | |
* |
This file contains hidden or 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 | |
namespace app\components; | |
use Yii; | |
use yii\base\Exception; | |
class ApiCached extends ApiWrapper | |
{ | |
const DEFAULT_CACHE_DURATION = 600; |
This file contains hidden or 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
public function testSlugifyDashSpace() { | |
$faker = Faker\Factory::create(); | |
$faker->addProvider(new Faker\Provider\Lorem($faker)); | |
$str1 = $faker->word; | |
$str2 = $faker->word; | |
$this->assertEquals($str1.' '.$str2, TextHelper::slugifyDashSpace($str1.' '.$str2)); | |
Yii::$app->params['slugifyDashSpace'][Yii::$app->params['projectCode']] = true; | |
$this->assertEquals($str1.' '.$str2, TextHelper::slugifyDashSpace($str1.'-'.$str2)); | |
} |
This file contains hidden or 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 | |
namespace namespaces; | |
abstract class Singleton | |
{ | |
// an array of instances. this will keep track of objects already created | |
private static $instances = []; | |
abstract protected function __construct(); | |
// this function gets called whenever there is a request for a static function |
This file contains hidden or 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 | |
use yii\base\Component; | |
use yii\base\Behavior; | |
class api extends Components { | |
} |
This file contains hidden or 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 | |
use yii\base\Arrayable; | |
use yii\base\ArrayableTrait; | |
use yii\base\Component; | |
use yii\helpers\ArrayHelper; | |
class News extends Component implements Arrayable | |
{ | |
use ArrayableTrait; | |
protected $article_title = ''; |
This file contains hidden or 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
//repl.it/repls/LimeWholeRedundancy | |
function solution(record) { | |
var answer = []; | |
var dbUser = {}; | |
for (var index in record) { | |
var commands = record[index].split(' '); | |
switch(commands[0]) { |
OlderNewer