This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class ApiDataLogger | |
| { | |
| private $startTime; | |
| /** | |
| * Handle an incoming request. | |
| * | |
| * @param \Illuminate\Http\Request $request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Gulp 4 | |
| var gulp = require('gulp'); | |
| var using = require('gulp-using'); | |
| var grep = require('gulp-grep'); | |
| var changed = require('gulp-changed'); | |
| var del = require('del'); | |
| var coffee = require('gulp-coffee'); | |
| var less = require('gulp-less'); | |
| var coffeelint = require('gulp-coffeelint'); | |
| var sourcemaps = require('gulp-sourcemaps'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import json | |
| from flask import Flask, url_for | |
| from flask_sqlalchemy import SQLAlchemy | |
| """ | |
| Flask-SQLAlchemy many-to-many relationship using helper table | |
| http://flask-sqlalchemy.pocoo.org/2.1/models/ | |
| Hippies love their dogs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //In case anyone was having the same issue in getting toastr to run with webpack and es6 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env python3 | |
| import logging | |
| from logging.handlers import RotatingFileHandler | |
| from flask import Flask, request, jsonify | |
| from time import strftime | |
| import traceback | |
| app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example of combining Flask-Security and Flask-Admin. | |
| # by Steve Saporta | |
| # April 15, 2014 | |
| # | |
| # Uses Flask-Security to control access to the application, with "admin" and "end-user" roles. | |
| # Uses Flask-Admin to provide an admin UI for the lists of users and roles. | |
| # SQLAlchemy ORM, Flask-Mail and WTForms are used in supporting roles, as well. | |
| from flask import Flask, render_template | |
| from flask.ext.sqlalchemy import SQLAlchemy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import uuid | |
| import wtforms_json | |
| from sqlalchemy import not_ | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from wtforms import Form | |
| from wtforms.fields import FormField, FieldList | |
| from wtforms.validators import Length | |
| from flask import current_app as app | |
| from flask import request, json, jsonify, abort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Published under GPL | |
| // tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/ | |
| class Developer_Import { | |
| public function __construct() { | |
| add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // install | |
| // npm i gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy | |
| var imagemin = require('gulp-imagemin'); | |
| var imageminPngquant = require('imagemin-pngquant'); | |
| var imageminZopfli = require('imagemin-zopfli'); | |
| var imageminMozjpeg = require('imagemin-mozjpeg'); //need to run 'brew install libpng' | |
| var imageminGiflossy = require('imagemin-giflossy'); | |
| //compress all images | |
| gulp.task('imagemin', function() { |