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
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 / 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>
@ChuckJonas
ChuckJonas / ts-force-example.ts
Last active April 7, 2018 04:45
BASS ts-force example
let accId = 'blah';
let accounts = await Account.retrieve(
`SELECT ${generateSelect(Object.values(Account.FIELDS))},
(
SELECT Owner.Id, Owner.Name
FROM ${Account.FIELDS.contacts.apiName}
)
FROM Account
WHERE Id = '${accId}'`
);
@ChuckJonas
ChuckJonas / ts-force-config.json
Last active April 20, 2018 03:48
BASS ts-force example
{
"auth": {
"username": "my-dev"
},
"sObjects": [
"Account",
"User",
{
"apiName": "Contact",
"fieldMappings": [