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
private ArrayAdapter<String> getEmailAddressAdapter(Context context) { | |
Account[] accounts = AccountManager.get(context).getAccountsByType("com.google"); | |
String[] addresses = new String[accounts.length]; | |
for (int i = 0; i < accounts.length; i++) { | |
addresses[i] = accounts[i].name; | |
} | |
return new ArrayAdapter<String>(context, android.R.layout.simple_dropdown_item_1line, addresses); | |
} |
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
<?php | |
class MyModel extends Eloquent { | |
public function getSql() | |
{ | |
$builder = $this->getBuilder(); | |
$sql = $builder->toSql(); | |
foreach($builder->getBindings() as $binding) | |
{ |
<?php | |
// app/config/testing/database.php | |
return [ | |
'default' => 'sqlite', | |
'connections' => [ | |
'sqlite' => [ | |
'driver' => 'sqlite', | |
'database' => ':memory:', | |
'prefix' => '', |
public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
private final Context context; | |
@Inject @ClientId String clientId; | |
@Inject @ClientSecret String clientSecret; | |
@Inject ApiService apiService; | |
public AccountAuthenticator(Context context) { | |
super(context); |
Redis::connection()->del('queues:myqueue'); |
<?php | |
/* | |
* | |
|-------------------------------------------------------------------------- | |
| Listado de Provincias de España vinculadas a Comunidad Autónoma y País | |
| Formato: Laravel 5.1 seed | |
| Autor: Damián Aguilar | |
| http://www.damianaguilar.es | |
| Twitter: @daguilarm |
const wait = time => new Promise((resolve) => setTimeout(resolve, time)); | |
wait(3000).then(() => console.log('Hello!')); // 'Hello!' |
[program:autossh] | |
command=autossh -M0 -N | |
-o "ExitOnForwardFailure yes" | |
-o "ServerAliveInterval 15" | |
-o "ServerAliveCountMax 4" | |
-o "ControlPath none" | |
-o "UserKnownHostsFile=/dev/null" | |
-o StrictHostKeyChecking=no | |
-R 1234:localhost:1234 | |
-R 4567:localhost:4567 |
methods: { | |
remove() { | |
this.removed = true | |
this.$emmit('removed') | |
} | |
} |