Skip to content

Instantly share code, notes, and snippets.

@noone0
noone0 / centos_php7_fresh.sh
Created Feb 7, 2018 — forked from nunorbatista/centos_php7_fresh.sh
PHP7 Centos 7 fresh install script
View centos_php7_fresh.sh
#/!/bin/bash
# update system
yum update -y
# install bind-utils
sudo yum install bind-utils
# Apache
yum install nano wget curl vim git httpd -y
@noone0
noone0 / curl-multi-test.php
Created Feb 26, 2017 — forked from gilbitron/curl-multi-test.php
Testing 95 regular curl_exec requests vs curl_multi_exec requests
View curl-multi-test.php
<?php
$sites = [
'http://www.google.com/',
'http://www.facebook.com/',
'http://www.youtube.com/',
'http://www.yahoo.com/',
'http://www.live.com/',
'http://www.wikipedia.org/',
'http://www.baidu.com/',
@noone0
noone0 / AWSLambdaSimpleVoice.js
Created Feb 26, 2017 — forked from nickmalcolm/AWSLambdaSimpleVoice.js
AWS Lambda Function to make Voice calls via the Twilio API
View AWSLambdaSimpleVoice.js
// 2016 MIT licence. Nick Malcolm.
// Based on https://gist.github.com/stevebowman/7cff9dd80b227c899728
// Makes a call using Twilio's API.
// Expects the following Lambda environment variables:
// TWILIO_ACCOUNT_SID - your account ID
// TWILIO_AUTH_TOKEN - an auth token generated in the Twilio console e.g. ABCD1234
// TWILIO_FROM_NUMBER - the number you've purchased to make calls from e.g. +14243700000
// We'll call this number
View functional restfull call
function callApi($method, $function, $data = false)
{
$curl = curl_init();
$url = $this->parentUrl.$function;
switch ($method)
{
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
View gist:2d5fcd6d82ab2078adcc8596137138fa
function resize($image, $width, $height, $mod,$waterMarkImage =false)
{
if ( ! file_exists($image)) exit;
$imageModified = @filemtime($image);
$image_properties = getimagesize($image);
if ( ! $image_properties) {
return false;
}
//---------------------------------------------
$image_width = $image_properties[0];