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); | |
} |
<?php | |
// app/config/testing/database.php | |
return [ | |
'default' => 'sqlite', | |
'connections' => [ | |
'sqlite' => [ | |
'driver' => 'sqlite', | |
'database' => ':memory:', | |
'prefix' => '', |
methods: { | |
remove() { | |
this.removed = true | |
this.$emmit('removed') | |
} | |
} |
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
[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 |
<?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 |
$ sudo apt install software-properties-common | |
$ sudo add-apt-repository ppa:ondrej/php | |
$ sudo apt update | |
$ sudo apt install php8.0-fpm php8.0-cli php8.0-common php8.0-curl php8.0-gd php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-sqlite3 php8.0-xml php8.0-zip | |
$ laravel -v | |
Laravel Installer 4.2.9 | |
$ composer global update | |
$ laravel -v | |
Laravel Installer 4.2.10 | |
$ laravel new prova && cd prova |
const wait = time => new Promise((resolve) => setTimeout(resolve, time)); | |
wait(3000).then(() => console.log('Hello!')); // 'Hello!' |
Redis::connection()->del('queues:myqueue'); |
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); |