Skip to content

Instantly share code, notes, and snippets.

@pcon
pcon / remote_holder.scad
Created September 17, 2023 17:38
A remote holder designed to go on a standard two gang switch plate and hold a remote for a Home Decorations fan remote
use <../lib/roundedcube.scad>
WALL_WIDTH = 1.5;
REMOTE_DEPTH = 16.5;
REMOTE_WIDTH = 35.5;
REMOTE_HEIGHT = 90;
REMOTE_LIP = 2;
SWITCH_WIDTH = 11;
@pcon
pcon / pihole.sh
Created September 19, 2020 18:48
#!/bin/bash
pihole -w android.clients.google.com
pihole -w reminders-pa.googleapis.com firestore.googleapis.com
pihole -w googleapis.l.google.com
pihole -w dl.google.com
pihole -w www.msftncsi.com
pihole -w outlook.office365.com products.office.com c.s-microsoft.com i.s-microsoft.com login.live.com login.microsoftonline.com
pihole -w g.live.com
pihole -w dl.delivery.mp.microsoft.com geo-prod.do.dsp.mp.microsoft.com displaycatalog.mp.microsoft.com
require 'restforce'
require 'faye'
Restforce.log = true
Restforce.configure do |config|
config.logger = Logger.new("/tmp/restforce.log")
config.log_leve = :info
end
@pcon
pcon / handle_certzip.sh
Created May 1, 2019 18:24
Takes a zip file from sslforfree.com and puts it into name.crt and name.key automatically
#!/bin/bash
readyn() {
read -n1 yn
}
loopyn() {
readyn
while [[ "$yn" != "y" && "$yn" != "n" ]]
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';
@RemoteAction
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')
@pcon
pcon / .bashrc
Last active April 23, 2018 22:11
if [ -f $HOME/.bashrc_local ]; then
. $HOME/.bashrc_local
fi
@pcon
pcon / .bashrc
Last active May 23, 2016 15:09
My Bash setup
#Add to .bashrc_sfdc
if [ -f $HOME/.bashrc_sfdc ]
then
. $HOME/.bashrc_sfdc
fi
@pcon
pcon / APIUtils.cls
Last active April 23, 2018 22:11
Web Services
/** 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;