We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
<?php | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
global $product; |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
<?php | |
namespace Controllers; | |
use OAuth\Common\Service\AbstractService; | |
use OAuth\Common\Storage\Session as OAuthSession; | |
class AuthController extends ControllerBase { | |
// everytime we enter the controller, then we check for login, if yes, then we dont have to access here (except logout) |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
user www-data; | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; |
server { | |
listen 80; | |
server_name localhost; | |
root /var/www; | |
client_max_body_size 32M; | |
location = /clear.gif { | |
empty_gif; | |
expires max; |
<?php | |
/* | |
* 1) open your invoice.php file | |
* 2) comment: // $wpo_wcpdf->billing_address(); | |
* 3) copy/pasta: the first php block you see below | |
* 4) copy/pasta: the second php block remove what you don't need | |
* 5) save | |
* 6) go ham! | |
*/ | |
?> |
class String | |
# SIRET or SIREN to French VAT number | |
def to_tva | |
siren = self[0..8].to_i | |
cle_tva = (((siren % 97) * 3) + 12) % 97 | |
(cle_tva < 10) ? "FR0#{cle_tva} #{siren}" : "FR#{cle_tva} #{siren}" | |
end | |
end |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers