Skip to content

Instantly share code, notes, and snippets.

View spinegar's full-sized avatar

Sean Pinegar spinegar

View GitHub Profile
<?php
$iso_array = array(
'ABW'=>'Aruba',
'AFG'=>'Afghanistan',
'AGO'=>'Angola',
'AIA'=>'Anguilla',
'ALA'=>'Åland Islands',
'ALB'=>'Albania',
'AND'=>'Andorra',
'ARE'=>'United Arab Emirates',
<?php namespace Sugar\Api;
use Guzzle\Common\Event;
use Guzzle\Http\Client;
use Guzzle\Http\Query;
/**
* SugarCRM 7 REST API Class
*
@spinegar
spinegar / SugarElasticSearchIndex.php
Created August 19, 2014 19:31
A script to index ElasticSearch after performing Sugar database work.
<?php
require('vendor/autoload.php');
$sugar = new \Spinegar\Sugar7Wrapper\Rest();
$sugar->setUrl('https://sugar/rest/v10/')
->setUsername('admin')
->setPassword('secretpassword')
->connect();
@spinegar
spinegar / Index ElasticSearch from CLI
Created August 20, 2014 21:27
Index ElasticSearch in Sugar 7 via CLI
$ php silentFTSIndex.php
@spinegar
spinegar / checkjQuery.js
Created February 20, 2013 17:45
Check if jquery is loaded, if not load it.
<script>
if(!window.jQuery)
{
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "path/to/jQuery";
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
@spinegar
spinegar / btn-flat.css
Created June 11, 2013 16:54
btn-flat and btn-inverse styling
.btn-inverse:active,
.btn-inverse.active {
background-color: #080808 \9;
}
.btn-flat {
filter:progid:DXImageTransform.Microsoft.Gradient(enabled='false');
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
@spinegar
spinegar / gist:6544125
Last active December 22, 2015 22:59
composer install
$ composer install
@spinegar
spinegar / gist:6544367
Last active December 22, 2015 23:08
Require Guzzle
{
"require": {
"guzzle/guzzle": "~3.1.1"
}
}
@spinegar
spinegar / logic_hooks.php
Last active December 22, 2015 23:08
SugarCRM Logic Hook Wishes
<?php
$hook_array['before_save'][] = [
'label' => 'before_save_example',
'logic'=>
function(&$bean, $event, $arguments){
//logic
}
];
@spinegar
spinegar / logic_hooks_class.php
Created September 12, 2013 22:12
Logic Hook Sample Class
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class logic_hooks_class
{
function before_save_method($bean, $event, $arguments)
{
//logic
}