Skip to content

Instantly share code, notes, and snippets.

View greenstork's full-sized avatar

Dave Manelski greenstork

  • Salesforce Foundation
  • Seattle, WA
View GitHub Profile
@greenstork
greenstork / Feedback Widget
Last active August 29, 2015 14:10
Visualforce/JS Feedback widget
<div id="feedback">
<div id="feedback-widget" style="z-index:300;display:none;">
<a class="handle" style="border-left:1px solid #ddd;border-top:1px solid #ddd;border-bottom:1px solid #ddd;" href="#">Feedback</a>
<div id="feedback-frame" style="display:none;">
</div>
</div>
</div>
public with sharing class FutureTest {
@future
public static void createAccountFuture() {
Account a = new Account(Name='Test Account');
//User with the standard Read Only profile should not be able to insert an account
insert a;
}
///////////////TESTS////////////////////
//constructor
public PubHomeController() {
pub = [SELECT id FROM Network WHERE Name LIKE '%Power of Us%'];
}
public class Topic {
public String createdDate { get; private set; }
public String id { get; private set; }
public String description { get; private set; }
public Integer talkingAbout { get; private set; }
@greenstork
greenstork / Component
Created August 5, 2013 19:18
Power of Us Hub terms of use component and controller. It depends on Twitter Bootstrap, namespaced for use in a Visualforce page, and the plugin called Bootstrap Scroll Modal - https://github.com/aroc/Bootstrap-Scroll-Modal
<apex:component allowDML="true" controller="PUB_TOUController">
<apex:includeScript value="{!URLFOR($Resource.pubstyles, 'js/bootstrap-scroll-modal.js')}" />
<apex:styleSheet value="{!URLFOR($Resource.pubstyles, 'css/bootstrap-scroll-modal.css')}" />
<style>
.bootstrap .modal-backdrop, .bootstrap .modal-backdrop.fade.in {
opacity:1;
}
</style>
@greenstork
greenstork / QandARSS
Created July 18, 2013 20:35
Visualforce page and controller for surfacing an RSS feed of Questions from Salesforce.
<apex:page controller="PUBQandARSSController" contentType="text/xml" showHeader="false" sidebar="false" cache="false"><?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Power of Us Hub Questions Feed</title>
<description>These are the 50 most recently asked questions on the Power of Us Hub</description>
<link>http://powerofus.salesforcefoundation.org</link>
<apex:repeat value="{!questions}" var="q">
<item>
<title>{!q.title}</title>
<description>{!q.description}</description>