Skip to content

Instantly share code, notes, and snippets.

View james-gibson's full-sized avatar
:shipit:
Exiting VSCode with :wq

James Gibson james-gibson

:shipit:
Exiting VSCode with :wq
View GitHub Profile
@james-gibson
james-gibson / SummarizeAccountContacts
Created September 5, 2014 15:54
Contact summary trigger w/test
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);
}
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 August 17, 2015 00:39
Description on how to set up wifi on raspberry pi running raspian

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 September 16, 2015 22:26
Creating Custom Invoice Templates in Apto

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 October 5, 2012 13:07
Stackoverflow Dependency question

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:

<amcharts:AmGraph
id="icGraph"
fillAlphas="[1]"
fillColors="[mbtuUsageColor]"
lineAlpha="0"
title=""
type="column"
valueAxis="{contributionAxis}"
valueField="percentOfInstallationMbtuUsage"
/>
<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 November 7, 2012 16:03
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."]}}"
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 20:38
lones block changes
{
"blockSummary": {
"0": {
"placed": 5,
"destroyed": 150
},
"1": {
"placed": 621,
"destroyed": 0
},
@james-gibson
james-gibson / tabularExample
Created October 10, 2013 22:30
Prototyped attempt at describing a bar/line series chart through a tabular like format using nested arrays.
[["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"]]