Skip to content

Instantly share code, notes, and snippets.

View dv336699's full-sized avatar
😬
I may be slow to respond.

Diego dv336699

😬
I may be slow to respond.
View GitHub Profile
@dv336699
dv336699 / php-pools.md
Last active October 15, 2020 20:47 — 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.

  • grep max_children /var/log/php-fpm/error.log
@dv336699
dv336699 / UserAgentInterceptor.java
Created June 29, 2018 17:41 — forked from twaddington/UserAgentInterceptor.java
Injects a User-Agent header into outgoing OkHttp requests.
package com.enlighthq.mobile.http;
import android.os.Build;
import java.io.IOException;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
@dv336699
dv336699 / make-kiosk.sh
Created June 5, 2018 09:50 — forked from voor/make-kiosk.sh
Configuring Kiosk Mode on CentOS
#!/bin/bash
# KIOSK generator for Scientific Linux and CentOS (versions 5; 6 and 7)
# Created using Scientific Linux
# Wasn't made and never tested on different distros than SL/CentOS/EL!
# Version 1.4 for i386 and x86_64
#
# Feel free to contact me: [email protected]
# www.marcinwilk.eu
# Marcin Wilk
@dv336699
dv336699 / epub.css
Last active May 21, 2018 20:05 — forked from maticrivo/epub.css
You Don't Know JS Ebooks
/* -------------------------------------------------------------- */
/* You don't need to save this file, just use the .sh files below */
body {
text-align: justify;
}
code, pre {
font-family: "Hack", monospace;
}
@dv336699
dv336699 / commit-message-guidelines.md
Last active February 19, 2018 12:04 — forked from robertpainsi/commit-message-guidelines.md
Commit message guidelines

Commit Message Guidelines

Short (50 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
<?php
namespace Sstalle\php7cc;
use PhpParser\PrettyPrinter\Standard as StandardPrettyPrinter;
use Sstalle\php7cc\CompatibilityViolation\CheckMetadata;
use Sstalle\php7cc\CompatibilityViolation\ContextInterface;
use Sstalle\php7cc\CompatibilityViolation\Message;
class CLIResultPrinter implements ResultPrinterInterface
@dv336699
dv336699 / README.md
Last active May 13, 2016 19:39 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?php //FILE: sms_api.php
function sendSMS($number,$message,$concat = 1) {
$url = "example"; // Set your frontlinesms or frontlinecloud webconnection url here
$secret = "secret"; // Set the secret here
$request = array(
'secret' => $secret,
'message' => $message,
'recipients' => array(array(