Skip to content

Instantly share code, notes, and snippets.

View ChuckJonas's full-sized avatar

Charlie Jonas ChuckJonas

  • Callaway Cloud Consulting
  • wyoming
View GitHub Profile
//Author: Charlie Jonas (charlie@callawaycloudconsulting.com)
// Description: Class is use for creating mock http callouts in test methods.
// See http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_testing_httpcalloutmock.htm
// for info on how to use class.
@isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {
//require properites
private Map<String,String> responseMap = new Map<String,String>();
class Greeting {
constructor(name) {
this.name = name;
}
get hello() {
return Greeting.intro + this.name;
}
<apex:page showHeader="false" sidebar="false" applyBodyTag="false">
<header>
<apex:outputPanel layout="none" rendered="{!$Label.Toggle_Local_Dev == '1'}">
<apex:stylesheet value="https://localhost:8080/statictesting.resource/styles.css"/>
</apex:outputPanel>
<apex:outputPanel layout="none" rendered="{!$Label.Toggle_Local_Dev != '1'}">
<apex:stylesheet value="{!URLFOR($Resource.StaticTesting, 'styles.css')}"/>
</apex:outputPanel>
</header>
@ChuckJonas
ChuckJonas / Apex Script.cs
Last active September 4, 2017 18:08
Little Heap of Horrors skill challenge
//replace with the id of uploaded image
ProductCreator.createProduct('[REPLACE]');
@ChuckJonas
ChuckJonas / Redux
Last active November 14, 2021 17:23
React React
[react-redux-typescript-guide](https://github.com/piotrwitek/react-redux-typescript-guide)
[FAQ](http://redux.js.org/docs/FAQ.html)
[Redux Actions in typescript](https://spin.atomicobject.com/2017/07/24/redux-action-pattern-typescript/)
```typescript
export enum TypeKeys {
INC = 'INC',
DEC = 'DEC',
OTHER_ACTION = '__any_other_action_type__'
}
@ChuckJonas
ChuckJonas / AnimalKinds.ts
Last active November 30, 2017 23:49
Typescript Discriminated Union Example
enum CreatureKind {
Dog = "Dog",
Wolf = "Wulf",
Cat = "Cat",
Tiger = "Tiger",
}
interface Barker {
bark: () => string;
}
@ChuckJonas
ChuckJonas / solution.ts
Created December 1, 2017 05:11
Generic Skill Challenge
//an alternate (and perhaps better approach)
interface IWeightedItem{
weight: number
}
interface Grade extends IWeightedItem{
score: number;
}
interface Product extends IWeightedItem{
@ChuckJonas
ChuckJonas / Challenge.ts
Created December 12, 2017 18:42
Spread Operator and Immutables
/* MERGING */
interface Foo{
kungfoo: string
}
interface ExtraFooy extends Foo{
tofu: string;
}
interface Bar{
interface Foo{
twittle: string;
doBarStuff(b: Bar): number;
fooOptional?: number
}
interface Bar{
one: number;
two: string;
}
@ChuckJonas
ChuckJonas / app.vf.html
Last active April 7, 2018 04:21
BASS-Medium
<apex:page showHeader="false" sidebar="false" standardStylesheets="false">
<script type="text/javascript">
//global injects
const __ACCESSTOKEN__ = '{!$Api.Session_ID}';
</script>
<div id="root"></div>
<script type='text/javascript' src="{!URLFOR($Resource.quote, 'vendors.js')}"></script>
<script type='text/javascript' src="{!URLFOR($Resource.quote, 'app.js')}" ></script>