Skip to content

Instantly share code, notes, and snippets.

View samuelsharaf's full-sized avatar

Samuel Sharaf samuelsharaf

  • Salesforce.com
  • San Francisco
View GitHub Profile
@samuelsharaf
samuelsharaf / Z4SF - LabExercise1
Last active August 29, 2015 14:04
Z4SF - LabExercise 1 - Create a simple Quote Page and Modify Title
<apex:page standardController="zqu__Quote__c" tabStyle="zqu__Quote__c" sidebar="false">
<apex:composition template="zqu__QuoteWizardTemplateNoForm">
<apex:define name="PageBody">
<zqu:CreateQuote subscriptionId="{!$CurrentPage.parameters.subscriptionId}"
billingAccountId="{!$CurrentPage.parameters.billingAccountId}"
opportunityId="{!$CurrentPage.parameters.oppId}"
crmAccountId="{!$CurrentPage.parameters.crmAccountId}"
renderBackButton="true"
title="MyTitle-Change this for lab exercise"/>
</apex:define>
@samuelsharaf
samuelsharaf / DefaultValues
Last active August 29, 2015 14:04
Z4SF-IPopulatePlugin Example
global class DefaultValues extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{
global override void populateDefaultFieldValue
(SObject record, zqu.PropertyComponentController.ParentController pcc)
{
super.populateDefaultFieldValue(record, pcc);
record.put('zqu__InitialTerm__c', 12);
record.put('zqu__RenewalTerm__c', 12);
record.put('zqu__ValidUntil__c', Date.today().addDays(30));
record.put('zqu__StartDate__c', Date.today());
record.put('zqu__PaymentMethod__c', 'Credit Card');
@samuelsharaf
samuelsharaf / html5starter.html
Created April 27, 2016 17:08
A barebone HTML GetStarted Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Starter Template</title>
<meta name="description" content="The HTML5 Template">
<meta name="author" content="Example">
@samuelsharaf
samuelsharaf / delete-heroku-apps.sh
Created March 27, 2017 21:56 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@samuelsharaf
samuelsharaf / delete-heroku-apps.sh
Created March 27, 2017 21:56 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
echo "\n-----------------------------"
echo "Updating Node..."
echo "-----------------------------\n"
. ~/.profile
nvm install 7
nvm alias default 7
echo "\n-----------------------------"
echo "Updating Heroku CLI..."
var pg = require('pg');
app.get('/db', function (request, response) {
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
client.query('SELECT * FROM test_table', function(err, result) {
done();
if (err)
{ console.error(err); response.send("Error " + err); }
else
{ response.render('pages/db', {results: result.rows} ); }