Skip to content

Instantly share code, notes, and snippets.

View yooouuri's full-sized avatar

Youri van Mill yooouuri

View GitHub Profile
<?php
namespace App\Http\Controllers\Admin;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
<?php
namespace App\Http\Middleware;
use App\User;
use Closure;
use Illuminate\Support\Facades\Auth;
class CheckAdmin
{
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
cd /opt/letsencrypt
# command uitvoeren
sudo -H ./letsencrypt-auto certonly --standalone --renew-by-default -d example.com -d www.example.com
# voorbeeld nginx conf
# jouw config is: /etc/nginx/sites-available/maartenpeels.com
# voeg onderstaande toe aan je server { ... } block
listen 443 ssl;
listen [::]:443 ssl;
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
cd /opt/letsencrypt
sudo -H ./letsencrypt-auto certonly --standalone --renew-by-default -d example.com -d www.example.com
# cronjob, maandelijks
echo '@monthly root /opt/letsencrypt/letsencrypt-auto certonly --quiet --standalone --renew-by-default -d example.com -d www.example.com >> /var/log/letsencrypt/letsencrypt-auto-update.log' | sudo tee --append /etc/crontab
# /etc/nginx/sites-enabled/yourivanmill.nl
@yooouuri
yooouuri / routes.php
Created February 21, 2017 13:58
Routes
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
<?php
namespace App\Providers;
use Faker\Factory;
use Faker\Generator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
// task model
'use strict';
module.exports = (sequelize, DataTypes) => {
const Task = sequelize.define('Task', {
name: DataTypes.STRING
});
Task.associations = function (models) {
Task.belongsTo(models.User, {
<!DOCTYPE html>
<html>
<head>
<title>Facebook Login JavaScript Example</title>
<meta charset="UTF-8">
</head>
<body>
<script>
// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
String url = "http://feetback-api.yourivanmill.nl/api/videos";
Request request = new Request.Builder()
.url(url)
.header("Authorization", String.format("Bearer %s", token))
.build();
OkHttpClient client = new OkHttpClient();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {