Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

James Gibson james-gibson

🏠
Working from home
View GitHub Profile
@james-gibson
james-gibson / SummarizeAccountContacts
Created Sep 5, 2014
Contact summary trigger w/test
View SummarizeAccountContacts
trigger SummarizeAccountContacts on Contact (after delete, after insert) {
set<ID> accountIds = new set<ID>();
set<ID> contactIds = new Set<ID>();
public void addValidAccountId(Id i)
{
if(i !=null)
accountIds.add(i);
}
View vimrc
syntax on
colorscheme distinguished
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set number
autocmd BufNewFile,BufRead *.json set ft=javascript
@james-gibson
james-gibson / raspPi-wifi.md
Created Aug 17, 2015
Description on how to set up wifi on raspberry pi running raspian
View raspPi-wifi.md

Run sudo cp /usr/share/doc/wpasupplicant/examples/wpa-roam.conf /etc/wpa_supplicant/wpa-roam.conf

Edit /etc/wpa_supplicant/wpa-roam.conf and uncomment update_config=1

and add:

network={
    ssid="<your ssid here>"
    psk="<wireless password here>"
}
@james-gibson
james-gibson / customInvoiceTemplateGuide.md
Last active Sep 16, 2015
Creating Custom Invoice Templates in Apto
View customInvoiceTemplateGuide.md

Apto Logo

##Custom Invoice Templates

Last Updated: 9/14/15

####Goal After following this guide, you should be able to create custom invoice templates by leveraging the custom invoice components and controllers, along with CSS.

####Prerequisites

@james-gibson
james-gibson / gist:3839713
Created Oct 5, 2012
Stackoverflow Dependency question
View gist:3839713

My colleagues and I are working to develop a more robust domain model for an application we are working on. The core entities that we are working with are "World", "Region", "Installation", and "Facility". The relationship to one another can be drawn as:

![enter image description here][1]

This means that our World object contains a collection of Regions, the Region object contains a collection of Installations, and the Installation object contains a collection of Facilities. This can be modeled as such:

![enter image description here][2]

With this design each collection is responsible for loading the appropriate objects. This includes executing an web service to obtain the proper objects. The owner of each collection is responsible for telling its collection when load itself. For instance:

View graph definition
<amcharts:AmGraph
id="icGraph"
fillAlphas="[1]"
fillColors="[mbtuUsageColor]"
lineAlpha="0"
title=""
type="column"
valueAxis="{contributionAxis}"
valueField="percentOfInstallationMbtuUsage"
/>
View graph definition
<amcharts:AmGraph
id="icGraph"
fillAlphas="[1]"
fillColors="[mbtuUsageColor]"
lineAlpha="0"
title=""
type="column"
valueAxis="{contributionAxis}"
valueField="percentOfInstallationMbtuUsage"
/>
@james-gibson
james-gibson / mapServer Error.txt
Created Nov 7, 2012
result "{"currentVersion":10.01,"error":{"code":400,"message":"Unable to complete operation.","details":["Service 'World_Imagery' of type 'MapServer' does not exist or is inaccessible."]}}"
View mapServer Error.txt
Main Thread (Suspended: TypeError: Error #1034: Type Coercion failed: cannot convert mx.rpc::Fault@bf8e3c1 to mx.rpc.events.FaultEvent.)
mx.rpc::AsyncResponder/fault
com.esri.ags.tasks::BaseTask/handleError
com.esri.ags.tasks::BaseTask/handleResult
Function/com.esri.ags.tasks:BaseTask/esri_internal:sendURLVariables2/com.esri.ags.tasks:result
mx.rpc::Responder/result
mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult
mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders
HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler
@james-gibson
james-gibson / gist:5687817
Created May 31, 2013
lones block changes
View gist:5687817
{
"blockSummary": {
"0": {
"placed": 5,
"destroyed": 150
},
"1": {
"placed": 621,
"destroyed": 0
},
@james-gibson
james-gibson / tabularExample
Created Oct 10, 2013
Prototyped attempt at describing a bar/line series chart through a tabular like format using nested arrays.
View tabularExample
[["month","current","prior","current-info","prior-info"],
["October",90,55,"October Usage was 90mbtu","October Usage was 55mbtu"],
["November",null,75,"November Usage is unavailable","November Usage was 75mbtu"],
["December",null,88,"December Usage is unavailable","December Usage was 88mbtu"],
["January",89,78,"January Usage was 89mbtu","January Usage was 78mbtu"]]