This file contains 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
ini_set('soap.wsdl_cache_enabled', 0); | |
ini_set('soap.wsdl_cache_ttl', 900); | |
ini_set('default_socket_timeout', 15); | |
$params = array('param1'=>$param1); | |
$wsdl = 'http://service_url/method?WSDL'; |
This file contains 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
{ | |
"books": [ | |
{ | |
"book": "Genesis", | |
"verses": 1533, | |
"chapters": 50 | |
}, | |
{ | |
"book": "Exodus", | |
"verses": 1213, |
This file contains 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 | |
/** | |
* Generate dynamic HTML emails | |
* | |
* @package Dynamic HTML PHPMailer builder | |
* @author Samuel Fonseca <[email protected]> | |
* @description Setup dynamic HTML emails using PHPMailer | |
*/ | |
/** |
This file contains 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 | |
/** | |
* Get content from the database | |
* | |
* @param $fields an array with what columns to pull | |
* @param $table which table to query | |
* | |
* @return $content with the table content | |
* @return $message with either an error or success message | |
*/ |
This file contains 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 | |
# I create a private function because it's used within my class, I only call it from the class itself | |
private function parseErrorString( $string ) | |
{ | |
// create delimiters here | |
$delimiters = array('-', "\r\n", "\n", "\r", "chr(13)"); | |
// start by replacing the $delimiters | |
$ready = str_replace( $delimiters, $delimiters[0], $string ); | |
// create new list() item: |
This file contains 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
{ | |
"alphabet": [ | |
{ | |
"alpha": { | |
"low": "α", | |
"cap": "Α" | |
}, | |
"beta": { | |
"low": "β", | |
"cap": "Β" |
This file contains 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 | |
/** | |
* @var $file is an array with file data | |
* @var $targetDir string with path to directory | |
* @var $maxFileSize int with max Byte size | |
* @var $_allowedFileTypes a comma separated string with all the allowed extensions | |
*/ | |
function uploadFile(array $file, $targetDir, $maxFileSize = 100000, $_allowedFileTypes = '(jpg)') | |
{ | |
// create var from array |
This file contains 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
// source: https://stackoverflow.com/questions/2499567/how-to-make-a-json-call-to-a-url/2499647#2499647 | |
function getJSONP(url, success) { | |
var ud = '_' + new Date, | |
script = document.createElement('script'), | |
head = document.getElementsByTagName('head')[0] | |
|| document.documentElement; | |
window[ud] = function(data) { | |
head.removeChild(script); | |
success && success(data); |
This file contains 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
[ | |
{ | |
"name": "Alabama", | |
"abbreviation": "AL" | |
}, | |
{ | |
"name": "Alaska", | |
"abbreviation": "AK" | |
}, | |
{ |
This file contains 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
param([string] $Path, [switch] $Recurse, [int] $Depth, [switch] $Force, [string] $Exclude, [switch] $Help) | |
if ($Help) { | |
Write-Output "This script is meant to delete all macOS dot files which serve no purpose on Windows." | |
Write-Output "When copying a large number of files, simply copy them onto the Windows machine, then run this script" | |
Write-Output "./removeMacOSDotFiles.ps1 | |
[[-Path] <string>] | |
[[-Depth] <int>] | |
[-Recurse] | |
[-Force] |
OlderNewer