Skip to content

Instantly share code, notes, and snippets.

@pcon
pcon / NullField.xml
Created August 9, 2012 19:58
Null fields in SFDC via SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>${#Project#sessionid}</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:update>
<!--Zero or more repetitions:-->
<urn:sObjects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Contact">
@pcon
pcon / watch_repo.py
Created December 19, 2012 18:44
Watches a folder for a new rpm and runs createrepo after it has been updated. Plus sends a pushover notification.
import re
import httplib, urllib
from subprocess import call
ROOT_DIR = '/path/to/dir'
wm = pyinotify.WatchManager();
mask = pyinotify.IN_CLOSE_WRITE
def pushover(message):
#!/bin/bash
nick="NICKGOESHERE"
participant_password="PASSWORD"
leader_password="PASSWORD"
sid="SID"
output="/tmp/meeting.jnlp"
launch_on_download="true"
#############################################################################
@pcon
pcon / Alternate.cls
Last active December 12, 2015 01:48
// Alternate way to get the name from a given Id
String objName = objId.getSObjectType().getDescribe().getName();
[solenopsis]
name=Solenopsis
baseurl=http://rpm.solenopsis.org/
enabled=1
gpgcheck=0
@pcon
pcon / .mailcap
Created March 20, 2013 12:58
Configurations for mutt and lynx
text/html; lynx -dump -width=78 -nolist %s | sed ‘s/^ //’; copiousoutput; needsterminal; nametemplate=%s.html
@pcon
pcon / sfdclogin.casper.js
Last active December 19, 2015 12:49
CasperJs logging into Salesforce
/*jslint browser: true, regexp: true */
/*global casper, require */
var LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, casp;
casp = require('casper').create({
viewportSize: {
width: 1024,
height: 768
},
/*jslint browser: true, regexp: true */
/*global casper, require, jQuery*/
var BASE_URL, LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, SCHEDULED_JOBS_URI, casp;
casp = require('casper').create({
clientScripts: [
'jquery.min.js'
],
viewportSize: {
@pcon
pcon / gist:7122968
Last active December 26, 2015 08:29
#
# Define some colors first: Capitals denote bold
#
red='\e[0;31m'
RED='\e[1;31m'
green='\e[0;32m'
GREEN='\e[1;32m'
yellow='\e[0;33m'
YELLOW='\e[1;33m'
blue='\e[0;34m'
@pcon
pcon / gist:7452472
Last active November 25, 2019 15:53
/**
* Sleep at least a second
*
* Found at: http://boards.developerforce.com/t5/Apex-Code-Development/Best-way-to-delay-until-time-changes-in-a-test/td-p/389619
*
*/
public static void waitAtLeastASecond() {
Integer msPerS = 1000;
Datetime start = Datetime.now();
Datetime current = Datetime.now();