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';
// Objective: demonstrate that there are more use cases | |
// for union types than previously thought. | |
// http://groups.google.com/group/golang-nuts/browse_thread/thread/fbde059a7cfd2fa9 | |
// | |
// Interface inference. | |
// We already have type inference, so this would be very Go-like: | |
type typeA int | |
func (x typeA) A() {} | |
func (x typeB) C() {} |
<?php | |
// Watermark with Imagick | |
// load images | |
$image = new Imagick("image.jpg"); | |
$watermark = new Imagick("watermark.png"); | |
// translate named gravity to pixel position | |
$position = gravity2coordinates($image, $watermark, 'lowerRight', 5, 5); | |
// compose watermark onto image |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
//function types | |
type mapf func(interface{}) interface{} |
<select name="state"> | |
<option value="ACT">Australian Capital Territory</option> | |
<option value="NSW">New South Wales</option> | |
<option value="NT ">Northern Territory</option> | |
<option value="QLD">Queensland</option> | |
<option value="SA ">South Australia</option> | |
<option value="TAS">Tasmania</option> | |
<option value="VIC">Victoria</option> | |
<option value="WA ">Western Australia</option> | |
</select> |
Windows Registry Editor Version 5.00 | |
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder] | |
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder] |
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
choco install Atom | |
choco install notepadplusplus.install | |
choco install 7zip | |
choco install flashplayerplugin | |
choco install vlc | |
choco install nodejs | |
choco install vcredist2010 | |
choco install PowerShell |
<templateSet group="BenSmith-Annotations"> | |
<template name="anno" value="/** * $ANNOTATIONS$ * @return Response */" description="Add docblock ready for annotations below" toReformat="false" toShortenFQNames="true"> | |
<variable name="ANNOTATIONS" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML_TEXT" value="true" /> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="@G" value="@Get("$ROUTE$", as="$NAME$")" description="Get route annotation" toReformat="false" toShortenFQNames="true"> |
sudo su - | |
mkdir -p /opt/bin | |
curl -L https://github.com/docker/compose/releases/download/1.5.1/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |