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';
| # Run me with: | |
| # | |
| # $ nginx -p /path/to/this/file/ -c nginx.conf | |
| # | |
| # All requests are then routed to authenticated user's index, so | |
| # | |
| # GET http://user:password@localhost/_search?q=* | |
| # | |
| # is rewritten to: | |
| # |
| <?php | |
| /** | |
| * Example filter to add text style to TinyMCE filter with Mark's "MRW TinyMCE Mods" plugin | |
| * | |
| * Adds a "Text Styles" submenu to the "Formats" dropdown | |
| * | |
| * This would go in a functions.php file or mu-plugin so you don't have to modify the original plugin. | |
| * | |
| * $styles array Contains arrays of style_format arguments to define styles. | |
| * Note: Should be an "array of arrays" |
| <?php | |
| function auto_login() { | |
| if (!is_user_logged_in()) { | |
| //determine WordPress user account to impersonate | |
| $user_login = 'anonymous'; | |
| //get user's ID | |
| $user = get_userdatabylogin($user_login); | |
| $user_id = $user->ID; |
| server { | |
| listen 80; | |
| root /var/www/craft.dev/public; | |
| index index.php index.html index.htm; | |
| server_name craft.dev; | |
| location / { | |
| try_files $uri $uri/ @rewrites; |
| add_filter('post_thumbnail_html', 'slug_responsive_img', 5, 5); | |
| //Image sizes for Interchange | |
| add_image_size( 'fd-lrg', 1024, 99999); | |
| add_image_size( 'fd-med', 768, 99999); | |
| add_image_size( 'fd-sm', 320, 9999); | |
| function slug_responsive_img($html, $post_id, $post_thumbnail_id, $size, $attr) { | |
| //make image links | |
| $attachment_id = $post_thumbnail_id; | |
| $default = wp_get_attachment_image_src($attachment_id); |
| 'use strict'; | |
| module.exports = function(grunt) { | |
| // load all grunt tasks | |
| require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
| grunt.initConfig({ | |
| // watch for changes and trigger compass, jshint, uglify and livereload | |
| watch: { |
| <?php | |
| /* | |
| Plugin name: Single user login | |
| Plugin URI: | |
| Description: | |
| Author: Ben May | |
| Author URI: | |
| Version: 0.1 | |
| */ |
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| # Download the compiled elasticsearch rather than the source. | |
| wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz | |
| tar -xf elasticsearch.tar.gz | |
| rm elasticsearch.tar.gz | |
| sudo mv elasticsearch-* elasticsearch | |
| sudo mv elasticsearch /usr/local/share |