Skip to content

Instantly share code, notes, and snippets.

@minedun6
minedun6 / service.js
Created December 18, 2017 20:58 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
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;
}
@minedun6
minedun6 / geckodriver-install.sh
Created November 13, 2017 09:02 — forked from cgoldberg/geckodriver-install.sh
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/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
@minedun6
minedun6 / S3-CORS-config.xml
Created October 12, 2017 09:44 — forked from zxbodya/S3-CORS-config.xml
Client side uploads to s3, with pre-signed upload form (PHP/JS)
<?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>
@minedun6
minedun6 / App_Http_VideoStream.php
Created February 27, 2017 21:05 — forked from vluzrmos/App_Http_VideoStream.php
Laravel VideoStream.
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
@minedun6
minedun6 / README.md
Created February 26, 2017 19:08 — forked from stursby/README.md
Vue + Firebase + Auth Demo

Vue + Firebase + Auth Demo

A simple App using Vue.js & Firebase with Auth.

See the DEMO.

@minedun6
minedun6 / 1_README.md
Created February 8, 2017 19:08 — forked from Daniel15/1_README.md
Complete Google Drive File Picker example

Google Drive File Picker Example

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/

@minedun6
minedun6 / model.php
Created January 27, 2017 18:27 — forked from danken00/model.php
Laravel 5 model casting function
<?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
{
@minedun6
minedun6 / LaravelInterviewQuestions.md
Created December 12, 2016 11:28 — forked from lukevers/LaravelInterviewQuestions.md
Laravel Interview Questions

Laravel 5 Interview Questions

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.

General Questions

1. How long have you been using Laravel?

This question can help decide what level of questions to ask.

@minedun6
minedun6 / array_chunk.js
Created December 10, 2016 09:07 — forked from subimage/array_chunk.js
Javascript array chunk
// 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) {