Skip to content

Instantly share code, notes, and snippets.

@ksaylor11
ksaylor11 / .dockerignore
Last active May 15, 2018 21:06
Laravel Docker Configuration Files
# restricting which files get uploaded with context
.git
node_modules/
vendor
storage/framework/cache/**
storage/framework/sessions/**
storage/framework/views/**
@ksaylor11
ksaylor11 / index.html
Created May 8, 2018 14:36
Simple Bootstrap page template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="app.js"></script>
</head>
<body>
@ksaylor11
ksaylor11 / _variables.scss
Created May 8, 2018 14:26
Simple sass bootstrap variables configuration file
$bootstrap-sass-asset-helper: false !default;
//
// Variables
// --------------------------------------------------
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
@ksaylor11
ksaylor11 / app.scss
Created May 8, 2018 14:19
Simple Sass file for loading bootstrap sass
// Bootstrap
@import "~bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
@ksaylor11
ksaylor11 / index.js
Created May 8, 2018 14:16
Simple index.js file for loading Jquery and Bootstrap
window.$ = window.jQuery = require('jquery');
require('bootstrap');
require('bootstrap-sass');
require("../sass/app.scss");
@ksaylor11
ksaylor11 / webpack.config.js
Created May 8, 2018 14:10
Simple Webpack config for Bootstrap3 and Jquery
const path = require('path');
module.exports = {
entry: './src/js/index.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
alias: {
@ksaylor11
ksaylor11 / UserAuthorizationRefresh.php
Created April 26, 2018 19:13
Laravel User Authorization Refresh When Using Laravel-ADLDAP
<?php
namespace ClassVisits\Listeners;
use Adldap\Laravel\Events\AuthenticationSuccessful;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use ClassVisits\Domain\Models\User;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
@ksaylor11
ksaylor11 / auth.php
Last active April 19, 2018 18:58
Laravel auth.php for API Authentication
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
@ksaylor11
ksaylor11 / urls.py
Created April 18, 2018 20:02
django url with app as project root
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
urlpatterns = [
url(r'^', include('monitor.urls')),
url(r'^admin/', admin.site.urls),
]
@ksaylor11
ksaylor11 / select.blade.php
Created April 13, 2018 18:17
Laravel Select Component
<select id="{{{ $element }}}" name="{{{ $element }}}">
@foreach($choices as $choice)
<option value="{{{ $choice->id }}}" @php echo ((!is_null($selectId) && $selectId == $choice->id) ? 'selected': '' ); @endphp>{{{ $choice->name }}}</option>
@endforeach
</select>