Add a DSL to the PHP Finite package, borrowed from the Ruby StateMachine gem.
In your Stateful Class, add the stateMachineConfig()
method and call initStateMachine()
method at initialization (__contruct()
method).
Example
function toDeci(fraction) { | |
var result,wholeNum=0, frac, deci=0; | |
if(fraction.search('/') >=0){ | |
if(fraction.search('-') > 0){ | |
var wholeNum = fraction.split('-'); | |
frac = wholeNum[1]; | |
wholeNum = parseInt(wholeNum,10); | |
}else if(fraction.search(' ') > 0){ | |
var wholeNum = fraction.split(' '); | |
fraction = wholeNum[1]; |
Add a DSL to the PHP Finite package, borrowed from the Ruby StateMachine gem.
In your Stateful Class, add the stateMachineConfig()
method and call initStateMachine()
method at initialization (__contruct()
method).
Example
namespace common\components; | |
use \yii\web\UrlManager as BaseUrlManager; | |
class UrlManager extends BaseUrlManager { | |
protected $choice; | |
public function init() { | |
Component::init(); |
A triangle workflow involves an upstream project and a personal fork containing a development branch of the project.
This configuration makes git pull
merge changes from the upstream but git push
send local commits to the personal fork.
https://github.com/<project>
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: config.locationType, | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('app', function() { |
import Controller from 'ember-controller'; | |
export default Controller.extend({ | |
init() { | |
this._super(...arguments); | |
console.log('error controller initialised'); | |
} | |
}); | |
import Ember from 'ember'; | |
import { task, timeout, asyncComputed, emit } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
value: 23, | |
tweened: asyncComputed('value', function * (v) { | |
let targetValue = parseInt(v) || 0; | |
if (targetValue > 100) { |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('outside', { path: '/' }, function() { |
deploy: | |
- provider: script | |
skip_cleanup: true | |
script: node_modules/.bin/ember deploy development --activate --verbose | |
on: | |
branch: master | |
- provider: script | |
skip_cleanup: true | |
script: node_modules/.bin/ember deploy staging --activate --verbose | |
on: |