A simple App using Vue.js & Firebase with Auth.
See the DEMO.
import axios from 'axios'; | |
class Service { | |
constructor() { | |
let service = axios.create({ | |
headers: {csrf: 'token'} | |
}); | |
service.interceptors.response.use(this.handleSuccess, this.handleError); | |
this.service = service; | |
} |
#!/bin/bash | |
# download and install latest geckodriver for linux or mac. | |
# required for selenium to drive a firefox browser. | |
install_dir="/usr/local/bin" | |
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest) | |
if [[ $(uname) == "Darwin" ]]; then | |
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))') | |
elif [[ $(uname) == "Linux" ]]; then | |
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))') |
<?php | |
if (!function_exists('times')) { | |
function times ($i, $callback) { | |
return collect(range(1, $i))->each($callback) | |
} | |
} | |
// Usage |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> |
<?php | |
namespace App\Http; | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069 | |
*/ |
A simple App using Vue.js & Firebase with Auth.
See the DEMO.
This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.
Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.
See a demo at http://stuff.dan.cx/js/filepicker/google/
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Collection as EloquentCollection; | |
use Illuminate\Database\Eloquent\Model as IlluminateModel; | |
use Illuminate\Pagination\AbstractPaginator; | |
class Model extends IlluminateModel | |
{ |
This is a compiled list of Laravel interview questions. If Laravel is an engineer's PHP framework of choice, they definitely have potential to be a good candidate, but a lot of new PHP engineers have been into Laravel too. The framework itself is very welcoming to newcomers, which makes it easy for beginners to feel that they know more than they really do.
1. How long have you been using Laravel?
This question can help decide what level of questions to ask.
// Splits an array into equal sized chunks | |
Array.prototype.chunk = function(pieces) { | |
pieces = pieces || 2; | |
var len = this.length; | |
var mid = (len/pieces); | |
var chunks = []; | |
var start = 0; | |
for(var i=0;i<pieces;i++) { | |
var last = start+mid; | |
if (!len%pieces >= i) { |