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';
angular.module('dataSharing.controllers', []); | |
angular.module('dataSharing.services', ['ngResource']); | |
angular.module('dataSharing', ['dataSharing.controllers', 'dataSharing.services']); |
#!/usr/bin/env bash | |
# Fix network routing issues caused by Cisco AnyConnect VPN when using | |
# VirtualBox and boot2docker on Mac OS X. | |
# | |
# Environment: | |
# Mac OS X 10.9.5 | |
# VirtualBox 4.3.20 | |
# Cisco AnyConnect 3.1.04074 | |
# boot2docker v1.4.1 (Git commit: 43241cb) |
#!/bin/sh | |
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs | |
CERTS_DIR=/etc/ssl/certs | |
CAFILE=${CERTS_DIR}/ca-certificates.crt | |
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do | |
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert} | |
CERT_FILE=${CERTS_DIR}/${cert} | |
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null) |
<?php | |
namespace Acme\Html; | |
use Illuminate\Html\FormBuilder as IlluminateFormBuilder; | |
class FormBuilder extends IlluminateFormBuilder { | |
/** | |
* An array containing the currently opened form groups. |
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var minifycss = require('gulp-minify-css'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var phpunit = require('gulp-phpunit'); | |
var notify = require('gulp-notify'); | |
var gutil = require('gulp-util'); | |
var exec = require('child_process').exec; | |
var sys = require('sys'); | |
var livereload = require('gulp-livereload'); |
<?php | |
/********************************************************************************************* | |
* Example usage (In view) | |
* <div class="welcome"> | |
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?> | |
<?php echo Form::textField('first_name')?> | |
<?php echo Form::textField('last_name')?> | |
<?php echo Form::emailField('email')?> | |
<?php echo Form::passwordField('password')?> | |
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?> |
<?php | |
// Access a property with no restrictions | |
function stole($object,$property){ | |
$dict = (array)$object; | |
$class = get_class($object); | |
return isset($dict[$property])? | |
$dict[$property]:(isset($dict["\0*\0$property"])? | |
$dict["\0*\0$property"]:(isset($dict["\0$class\0$property"])? | |
$dict["\0$class\0$property"]:null)); |
d3.legend is a quick hack to add a legend to a d3
chart. Simply add a g
and .call(d3.legend)
. Any elements that have a title set in the "data-legend"
attribute will be included when d3.legend
is called. Each title will appear only once (even when multiple items define the same data-legend) as the process uses a set based on a existing names, not an array of all items.
By default the color in the legend will try to match the fill attribute or the stroke attribute of the relevant items. Color can be explicitly defined by attribute "data-legend-color"
The order of items in the legend will be sorted using the top of the bounding box for each included item. The order can be explicitly defined by attribute "data-legend-pos"
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |