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 | |
/** | |
* @file | |
* Basic demonstration of how to do parallel threads in PHP. | |
*/ | |
// This array of "tasks" could be anything. For demonstration purposes | |
// these are just strings, but they could be a callback, class or | |
// include file (hell, even code-as-a-string to pass to eval()). |
def multireplace(string, replacements, ignore_case=False): | |
""" | |
Given a string and a replacement map, it returns the replaced string. | |
:param str string: string to execute replacements on | |
:param dict replacements: replacement dictionary {value to find: value to replace} | |
:param bool ignore_case: whether the match should be case insensitive | |
:rtype: str | |
""" |
''' | |
Title : Pandas Row Shuffler | |
Author : Felan Carlo Garcia | |
''' | |
import numpy as np | |
import pandas as pd | |
def shuffler(filename): | |
df = pd.read_csv(filename, header=0) | |
# return the pandas dataframe |
{ | |
"name": "phindmarsh/composer-test", | |
"description": "Testcase for checking dependencies bug", | |
"require": { | |
"silex/silex": "dev-master#279c773342c6c4d141ebd5236b18518c96505e00" | |
}, | |
"authors": [ | |
{ | |
"name": "Patrick Hindmarsh", | |
"email": "patrick@hindmar.sh" |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
<?php | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial | |
*/ | |
class VideoStream | |
{ | |
private $path = ""; |
{ | |
"cmd": ["/usr/local/bin/Rscript", "$file"], | |
"selector": "source.r" | |
} |
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>localStorage Test</title> | |
<script type="text/javascript" > | |
var count = 0; | |
var storageHandler = function () { | |
alert('storage event 1'); | |
}; |