Skip to content

Instantly share code, notes, and snippets.

View charltonAthletic's full-sized avatar

Andy Hitchings charltonAthletic

View GitHub Profile
<apex:page >
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/40.0/connection.js"
type="text/javascript"></script>
<script type="text/javascript">
function getMetrics()
{
////////////////////////////////////////////////////////////////
// Title: Send email to contacts from a list view (no templates needed).
// Description:
// Allows for mass Salesforce emails without templates, with simply a click.
// Note that you could easily go over Salesforce's limits if you're not careful.
//
// By Alex Kadis, based on sources listed below, especially
// Matt Horine's "Email Affiliated Contacts button for use with
// Salesforce NPSP"
//
@emoran
emoran / gist:f911381c70ab81d8797da512701d6b1f
Created March 15, 2017 18:44
get all fields with values in a map like Map<FieldAPIName,RecordValue>
// Works for any SObjectType
SObjectType sobType = Account.SObjectType;
Map<String,String> m = new Map<String,String>();
List<String> fields = new List<String>(sobType.getDescribe().fields.getMap().keySet());
for (SObject sob : Database.query(''
+ ' select ' + String.join(fields, ',')
+ ' from ' + sobType
+ ' limit 1'
)) {
@vinhhungle
vinhhungle / create_topic.md
Last active November 25, 2018 10:46
Salesforce Streaming API Test

Open Dev Console > Debug > Open Execute Anonymous Window

Execute the codes below:

PushTopic pushTopic = new PushTopic();
pushTopic.ApiVersion = 37.0;
pushTopic.Name = 'AllAccounts';
pushTopic.Description = 'All records for the Account object';
pushtopic.Query = 'SELECT Id, Name FROM Account';
@schliflo
schliflo / frontend-testing.md
Last active January 3, 2023 09:46
A collection of frontend testing tips, tricks and tools

Frontend Testing

This is an incomplete collection of frontend testing tips, tricks and tools. It's just the stuff I've found useful over the years. Feel free to suggest more stuff. I'll add it if I like it ;)

Device Testing

Performance

@spaze
spaze / opera-vpn.md
Last active December 22, 2024 15:50
Opera VPN behind the curtains is just a proxy, here's how it works

2023 update

ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.

🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.


When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

@joepie91
joepie91 / vpn.md
Last active May 20, 2025 14:11
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@emoran
emoran / Visualforce Socket connection
Created October 14, 2015 16:56
How to connect to a socket published in Heroku from Visualforce
<apex:page showHeader="true" sidebar="true">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCu1PGlWXv9cLbWdaYgCh8M5gXvduD3LeM&libraries=geometry"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdn.socket.io/socket.io-1.3.7.js"></script>
<script>
@jgravois
jgravois / _webserver.md
Last active January 9, 2025 09:27
a simple guide for getting a local web server set up

Do I have a web server running?


having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (.html, .js etc.) in a browser via http://.

if you're not sure whether or not you have a web server running, no problem! its easy to confirm.

what happens when you visit http://localhost/?