Skip to content

Instantly share code, notes, and snippets.


Patrick Connelly pcon

View GitHub Profile
pihole -w
pihole -w
pihole -w
pihole -w
pihole -w
pihole -w
pihole -w
pihole -w
View eventmonitoring.rb
require 'restforce'
require 'faye'
Restforce.log = true
Restforce.configure do |config|
config.logger ="/tmp/restforce.log")
config.log_leve = :info
pcon /
Created May 1, 2019
Takes a zip file from and puts it into name.crt and name.key automatically
readyn() {
read -n1 yn
loopyn() {
while [[ "$yn" != "y" && "$yn" != "n" ]]
View FootballAPI.cls
public class FootballAPI {
public class GameWeather {
public String humidity {get;set;}
public String temp_celsius {get;set;}
public String temp_farenheit {get;set;}
public String wind_speed {get;set;}
public String description {get;set;}
public class GameTeam {
pmd -dir src/ -f text -language apex -R path/to/pmd.xml -cache path/to/cache/dir
public class ManageLeadTerritoryController {
@TestVisible private static String SCHEDULED_JOB_NAME = 'Mass Update Leads';
public static void massUpdateNow()
List<Territory_Setup__c> LeadTerrSetups = [select Id, Next_Mass_Update_Date_Lead__c, Status__c from Territory_Setup__c
order by lastmodifieddate desc limit 1];
if(LeadTerrSetups.size() > 0 && LeadTerrSetups[0].STatus__c == 'on')
View .bashrc
if [ -f $HOME/.bashrc_local ]; then
. $HOME/.bashrc_local
pcon / .bashrc
Last active May 23, 2016
My Bash setup
View .bashrc
#Add to .bashrc_sfdc
if [ -f $HOME/.bashrc_sfdc ]
. $HOME/.bashrc_sfdc
pcon / APIUtils.cls
Last active Apr 23, 2018
Web Services
View APIUtils.cls
/** This class is a utility class for WebServices and other API classes */
global with sharing class APIUtils {
/** Return codes to for returnCdoe */
global final static Integer STATUS_OK = 200;
global final static Integer STATUS_CREATED = 201;
global final static Integer STATUS_ACCEPTED = 202;
global final static Integer STATUS_BAD = 400;
global final static Integer STATUS_FORBIDDEN = 403;
global final static Integer STATUS_NOTFOUND = 404;
global final static Integer STATUS_NOTALLOWED = 405;
pcon / ExampleClass.cls
Last active Aug 29, 2015
Testing Strategy Code
View ExampleClass.cls
public static String uppercase(String name) {
if (name == null) {
return 'NULL';
if (name.trim() == '') {
return 'BLANK';
return name.toUpperCase();