Skip to content

Instantly share code, notes, and snippets.

View nickknissen's full-sized avatar

Nick nickknissen

  • Uptime Development
  • Denmark
View GitHub Profile
@nickknissen
nickknissen / php-pools.md
Created August 20, 2024 12:58 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@nickknissen
nickknissen / script.yaml
Created November 23, 2023 06:11 — forked from KeviinCosmos/script.yaml
Controller - EnOcean PTM 215Z (Friends of Hue) switch double press
blueprint:
name: Controller - EnOcean PTM 215Z (Friends of Hue) switch double press
description: 'Controller automation for executing press/double-press/hold/release actions triggered by
EnOcean PTM 215Z (Friends of Hue) switch.'
domain: automation
input:
controller_entity:
name: (Zigbee2MQTT) Controller Entity
description: The action sensor of the controller to use for the automation.
'use strict';
var sassMiddleware = require('./middleware/sass-middleware');
var angularTmplMiddleware = require('./middleware/angular-template-middleware');
var getEnv = require('./utils/get-env');
var AssetRewriter = require('./utils/asset-rewriter');
var fileMatches = require('./utils/file-matches');
var LiveReloadChanges = require('./utils/live-reload-changes');
var BROWSERS = [
'use strict';
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../../',
preprocessors: {
'**/*.html': ['ng-html2js']
/*
* Middleware to mock GoCardless API requests
*/
'use strict';
var url = require('url');
var _ = require('lodash');
var db = require('./database.js');
from flask import request, Flask
from cloudinary import uploader #pip install git+https://github.com/cloudinary/pycloudinary/
class Cloudinary(object):
def __init__(self, app):
config = app.config['CLOUDINARY_URL'].split('://')[1]
config = config.replace("@", ":")
self.api_key, self.api_secret, self.name = config.split(":")
var demoApp = angular.module('demoApp', ['ngResource'], function($locationProvider) {
$locationProvider.hashPrefix('');
});
function MainCtrl($scope, Serv) {
$scope.selectedItem = {
value: 0,
label: ''
};
$scope.Wrapper = Serv;