Skip to content

Instantly share code, notes, and snippets.

View blueridgemountains1's full-sized avatar

J.S. blueridgemountains1

View GitHub Profile
@blueridgemountains1
blueridgemountains1 / datatable-search.js
Created August 10, 2017 18:16
DataTables with Search and Defaults
var $dt = $('.dataTable')
.DataTable({
"lengthChange": true,
"pageLength": 21,
"paging": true,
"ordering": true,
"info": false,
"searching": true,
"stateSave": false,
"jQueryUI": false,
@blueridgemountains1
blueridgemountains1 / pusher-laravel.md
Last active August 14, 2017 16:11
Add Pusher to Laravel
  1. Add pusher PHP server to composer
"pusher/pusher-php-server": "^3.0",
  1. Require this package, with Composer, in the root directory of your project.
$ composer require vinkla/pusher
  1. Add the service provider to config/app.php in the providers array, or if you're using Laravel 5.5, this can be done via the automatic package discovery.
@blueridgemountains1
blueridgemountains1 / onesignal-laravel.md
Last active August 14, 2017 16:24
Add OneSignal to Laravel
  1. Add variables to .env file
ONESIGNAL_APP_ID=
ONESIGNAL_REST_API_KEY=
ONESIGNAL_USER_AUTH_KEY=
  1. Add OneSignal wrapper for Laravel via composer
composer require jmrieger/onesignal-laravel
@blueridgemountains1
blueridgemountains1 / HighlightImagesWithoutAltText.css
Last active March 18, 2018 16:33
Alert about Images without any alt text
img:not([alt]), img[alt=""] {
outline: 5px solid red;
}
/* you could also use this for admins on wordpress with the following */
.admin-bar img:not([alt]), .admin-bar img[alt=""] {
outline: 5px solid red;
}
@blueridgemountains1
blueridgemountains1 / CenterItemsInFlexAndGrid.css
Created March 18, 2018 16:37
Center Items in Flex and Grid
/** flex **/
.🦄 {
display: flex;
align-items: center;
justify-content: center;
}
/** grid **/
body {
display: grid;
@blueridgemountains1
blueridgemountains1 / MaterialDesignBoxShadows.css
Created March 18, 2018 16:37
Material Design Box Shadows
/** taken from https://codepen.io/sdthornton/pen/wBZdXq **/
.card-1 {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}
.card-1:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
@blueridgemountains1
blueridgemountains1 / ResponsiveTextSize.css
Created March 18, 2018 16:39
Responsive Text Size in Body
body {
font-size: calc(0.95rem + 0.1vw);
}
@blueridgemountains1
blueridgemountains1 / rationalize.css
Created March 18, 2018 16:41
Rationalize Reset CSS
/** taken from https://github.com/niksy/rationalize.css/blob/master/index.css **/
@import url('normalize.css');
@import url('opinionate.css');
/**
* =============================================================================
* Base
* =============================================================================
*/
@blueridgemountains1
blueridgemountains1 / CenterButtonText.css
Created March 18, 2018 16:49
Center Button Text in Boostrap and .btn class
.btn {
display: inline-flex;
align-content: center;
align-items: center;
}
@blueridgemountains1
blueridgemountains1 / SyncMediaQueriesJavaScript.css
Created March 18, 2018 17:42
Sync Media Queries with Javascript
/** Great way to sync media queries with your javascript: https://mobile.twitter.com/selbekk/status/975145895909117952 **/
body::before {
content: ‘small’,
display: none;
}
@media all and (min-width: 1000px) {
body::before {
content: ‘medium’;
}