sudo apt-get install python3-pip
sudo pip3 install virtualenv
object Example { | |
fun alterTableUsage(database: SupportSQLiteDatabase) { | |
DbMigrationsHelper.alterTable( | |
db = database, | |
tableName = "Reservations", | |
columns = mapOf( | |
"id INTEGER".toExisting(), // Retains without changes | |
"title TEXT".toExisting("name"), // Renames column "name" to "title" | |
"description TEXT".toNothing(), // Adds a new column |
FROM php:7.2-fpm | |
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# make sure apt is up to date | |
RUN apt-get update --fix-missing | |
RUN apt-get install -y curl | |
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev |
The solution above for 5.2 should still work. In 5.5+ you just need to change bootstrap/autoload.php to vendor/autoload.php. | |
<?php | |
require '/path/to/laravel/vendor/autoload.php'; | |
$app = require_once '/path/to/laravel/bootstrap/app.php'; | |
$app->make('Illuminate\Contracts\Http\Kernel') | |
->handle(Illuminate\Http\Request::capture()); |
<?php | |
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456 | |
use Illuminate\Database\Eloquent\Model as Eloquent; | |
use Illuminate\Database\Eloquent\Relations\Pivot; | |
class User extends Eloquent { | |
public function groups() { | |
return $this->belongsToMany('Group'); |
Color = function(hexOrObject) { | |
var obj; | |
if (hexOrObject instanceof Object) { | |
obj = hexOrObject; | |
} else { | |
obj = LinearColorInterpolator.convertHexToRgb(hexOrObject); | |
} | |
this.r = obj.r; | |
this.g = obj.g; | |
this.b = obj.b; |
[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character