Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
| <?php namespace Illuminate\Database\Connectors; | |
| class MySqlConnector extends Connector implements ConnectorInterface { | |
| /** | |
| * Establish a database connection. | |
| * | |
| * @param array $options | |
| * @return PDO | |
| */ |
| application: you-app-name-here | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| default_expiration: "30d" | |
| handlers: | |
| - url: /(.*\.(appcache|manifest)) | |
| mime_type: text/cache-manifest |
| // Retrieve JPEG width and height without downloading/reading entire image. | |
| function getjpegsize($img_loc) { | |
| $handle = fopen($img_loc, "rb") or die("Invalid file stream."); | |
| $new_block = NULL; | |
| if(!feof($handle)) { | |
| $new_block = fread($handle, 32); | |
| $i = 0; | |
| if($new_block[$i]=="\xFF" && $new_block[$i+1]=="\xD8" && $new_block[$i+2]=="\xFF" && $new_block[$i+3]=="\xE0") { | |
| $i += 4; | |
| if($new_block[$i+2]=="\x4A" && $new_block[$i+3]=="\x46" && $new_block[$i+4]=="\x49" && $new_block[$i+5]=="\x46" && $new_block[$i+6]=="\x00") { |
This gist assumes:
| <?php | |
| use Illuminate\Console\Command; | |
| use Illuminate\Filesystem\Filesystem; | |
| class ViewsCommand extends Command { | |
| /** | |
| * The console command name. | |
| * | |
| * @var string |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
This gist assumes:
| // test/fancy_test_context.dart | |
| library fancy_test_context; | |
| import 'dart:html'; | |
| import 'package:angular/angular.dart'; | |
| import 'package:angular/mock/module.dart'; | |
| /** | |
| * Global test context. | |
| */ |
| //Convenience array of status values | |
| var cacheStatusValues = []; | |
| cacheStatusValues[0] = 'uncached'; | |
| cacheStatusValues[1] = 'idle'; | |
| cacheStatusValues[2] = 'checking'; | |
| cacheStatusValues[3] = 'downloading'; | |
| cacheStatusValues[4] = 'updateready'; | |
| cacheStatusValues[5] = 'obsolete'; | |
| // Listeners for all possible events |