Skip to content

Instantly share code, notes, and snippets.

View rallat's full-sized avatar
🏠
Working from home

Israel Ferrer Camacho rallat

🏠
Working from home
View GitHub Profile
@rallat
rallat / DetailViewModel.kt
Created September 13, 2018 06:40 — forked from chrisbanes/ScopedViewModel.kt
ScopedViewModel
class DetailViewModel : ScopedViewModel() {
fun startTask() {
launch {
// Switch the 'background' thread
withContext(Dispatchers.Default) {
// do your long-running thing
}
// We're now back on the Android's Main thread
updateUi()
package controllers
import play.api.libs.ws.WS
import play.api.mvc.{Action, Controller}
import scala.concurrent.Future
class VerifyCredentialsController extends Controller {
implicit val context = scala.concurrent.ExecutionContext.Implicits.global
<?php
//number of people in the reservation
$people = 2;
//time, just the hour, pm
$time = 7;
$url = 'http://www.opentable.com/nextavailabletable.aspx?hpu=1025002033&shpu=1&rid=1180&m=4&d=8/13/2010+'.$time.':00:00+PM&p='.$people;
$data = file_get_contents($url);
$regex = '/\[\'\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}\:\d{2}\:\d{2} PM/';