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';
{ | |
"cmd": ["/usr/local/bin/Rscript", "$file"], | |
"selector": "source.r" | |
} |
{ | |
"name": "phindmarsh/composer-test", | |
"description": "Testcase for checking dependencies bug", | |
"require": { | |
"silex/silex": "dev-master#279c773342c6c4d141ebd5236b18518c96505e00" | |
}, | |
"authors": [ | |
{ | |
"name": "Patrick Hindmarsh", | |
"email": "patrick@hindmar.sh" |
''' | |
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 |
import binascii | |
from Crypto.Cipher import AES | |
data = "abcdefghijklmnopqrstuvwxyz" | |
key = "pqrstuvwxyz$abcdefghijAB" | |
iv = "DEFGHTABCIESPQXO" | |
encrypted = "2324ab5ec7a901247bf01b08bd1956688843dad5a8e15106ca3a5b9258918527" | |
cipher = AES.new(key, AES.MODE_CBC, iv) |
<?php | |
function encrypt($string, $key=5) { | |
$result = ''; | |
for($i=0, $k= strlen($string); $i<$k; $i++) { | |
$char = substr($string, $i, 1); | |
$keychar = substr($key, ($i % strlen($key))-1, 1); | |
$char = chr(ord($char)+ord($keychar)); | |
$result .= $char; | |
} | |
return base64_encode($result); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>localStorage Test</title> | |
<script type="text/javascript" > | |
var count = 0; | |
var storageHandler = function () { | |
alert('storage event 1'); | |
}; |
#!/usr/bin/env zsh | |
sudo rm -f /usr/bin/node | |
sudo rm -f /usr/bin/npm | |
sudo ln -s $(which node) /usr/bin/ | |
sudo ln -s $(which npm) /usr/bin/ |
const Moment = require('moment')
const array = [{date:"2018-05-11"},{date:"2018-05-12"},{date:"2018-05-10"}]
const sortedArray = array.sort((a,b) => new Moment(a.date).format('YYYYMMDD') - new Moment(b.date).format('YYYYMMDD'))
console.log(sortedArray)
If you're using [ASP.NET MVC3][], it uses [jQuery Validate][] to do client-side validations. Instead of using [jQuery Validate][] directly, however, it wraps it with its own jQuery plugin called [jQuery.Validate.Unobtrusive][]. [jQuery.Validate.Unobtrusive][] sets up [jQuery Validate][] for you, behind the scenes, so you don't have an opportunity to customize your [jQuery Validate][] settings at all!
We've been running into trouble with this when we've been doing our own custom client-side validations. We need a way to integrate with the build-in [ASP.NET MVC3][] validation so we can: