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';
codestyle.co examples |
#!/bin/sh | |
filename="$1" | |
extension=${filename##*.} | |
if [ ${extension} = "doc" ] | |
then | |
# Use cat doc for older document formats | |
catdoc "$filename" | |
else |
// Assume Coord has members x(), y() and z() and supports arithmetic operations | |
// that is Coord u + Coord v = u.x() + v.x(), u.y() + v.y(), u.z() + v.z() | |
inline Point | |
dot(const Coord& u, const Coord& v) | |
{ | |
return u.x() * v.x() + u.y() * v.y() + u.z() * v.z(); | |
} | |
inline Point |
/* --CSS Reseter-- */ | |
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, | |
article, aside, dialog, figure, header, footer, hgroup, menu, nav, section, time, mark, audio, video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
outline: 0; | |
font-weight: inherit; | |
font-style: inherit; |
javascript:(function(){ | |
var links=document.querySelectorAll('a.l'), | |
count=links.length; | |
while(count--){ | |
links[count].onmousedown=null; | |
if((/url=/i).test(links[count].href)){ | |
links[count].href=decodeURIComponent(links[count].href.match(/url=([a-z0-9\-+%._]+)&/i)[1].replace(/\+/g, ' ')); | |
} | |
}; | |
})() |
#!/bin/bash | |
# | |
# WP Commandline Local Install, by Brian Richards (@rzen) | |
# | |
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config, | |
# optionally empties wp-content, and deletes other misc files. This compliments my local | |
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/ | |
# | |
# Credit: | |
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php | |
*/ | |
$args = array( |
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 2 | |
Comment=Edit text files | |
Exec=/usr/local/sublime-text-2/sublime_text | |
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" |