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 | |
/* From https://www.usps.com/send/official-abbreviations.htm */ | |
$us_state_abbrevs_names = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AS'=>'AMERICAN SAMOA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', |
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
function setFieldRequired(fieldName, req, msgStr){ | |
if(!msgStr){ msgStr = fieldName; } | |
for(var i = 0; i < validate["EditView"].length; i++){ | |
if(validate["EditView"][i][nameIndex] == fieldName) { | |
validate["EditView"][i][msgIndex] = msgStr; | |
validate["EditView"][i][requiredIndex] = req; | |
break; | |
} | |
} | |
} |
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
type T struct { | |
A int | |
B string | |
} | |
t := T{23, "skidoo"} | |
s := reflect.ValueOf(&t).Elem() | |
typeOfT := s.Type() | |
for i := 0; i < s.NumField(); i++ { |
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 | |
// specify the REST web service to interact with | |
$baseurl = '<<instanceurl>>/rest/v10'; | |
/** | |
* Authenicate and get back token | |
*/ | |
$curl = curl_init($baseurl . "/oauth2/token"); | |
curl_setopt($curl, CURLOPT_POST, true); |
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
# Download from here: https://github.com/sugarcrm/Tidbit | |
# Copy Tidbit to your Sugar Root and unpack | |
cp Tidbit-master.zip /var/www/html | |
unzip Tidbit-master.zip | |
# Run Tidbit | |
cd Tidbit | |
php -f install_cli.php -- -c |
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
Apache: | |
- Activated 'KeepAlive' connections | |
- Lowered keep alive timeout from 15 seconds to 2 seconds | |
- Increased the number of minimum workers from 8 to 16 | |
- Activated server status page (/server-status) | |
APC (Alternative PHP Cache): | |
- Set cache size to 256MB (ideal for SugarCRM workload) | |
Memcache: |
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
server { | |
listen 8090; | |
server_name sugarcrmdev-71.dontesta.local; | |
#charset koi8-r; | |
access_log /var/log/nginx/sugarcrmdev-71.dontesta.local.access.log main; | |
error_log /var/log/nginx/sugarcrmdev-71.dontesta.local.error.log; | |
root /home/sugarcrm/application; | |
index index.php index.html; |
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
$countries = array( | |
"AF" => "_afghanistan", | |
"AX" => "_alandIslands", | |
"AL" => "_albania", | |
"DZ" => "_algeria", | |
"AS" => "_americanSamoa", | |
"AD" => "_andorra", | |
"AO" => "_angola", | |
"AI" => "_anguilla", | |
"AQ" => "_antarctica", |
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
/*** | |
* Convert standard ISO country codes to NetSuite's world | |
* | |
* @param $isoCode | |
* | |
* @return string|bool | |
*/ | |
public function convertCountryCode($isoCode) | |
{ |
OlderNewer