Skip to content

Instantly share code, notes, and snippets.

View gescandon's full-sized avatar

Geoff Escandon gescandon

View GitHub Profile
@gescandon
gescandon / sfdcProfileBoss.rb
Last active October 31, 2018 15:25
SFDC Profile Updater
#!/usr/bin/ruby
require 'Nokogiri'
allFields = true
isFiltered = false
isTestMode = false
PARTNER_COMMUNITY_LOGIN = "Partner Community Login"
CHATTER_EXTERNAL = "Chatter External"
SALESFORCE_PLATFORM = "Salesforce Platform"
<http>
<head>
<script src="/js/jquery-1.8.2.js"></script>
<style>
.card {
margin: 5%
}
#playpanel {
padding: 1px 1px 5px 20px;
}
@gescandon
gescandon / dancingStar.pde
Created July 3, 2017 16:45
DancingStar Processing visualization
DancingStar[] dstars;
void setup() {
size(1024, 768);
frameRate(24);
dstars = new DancingStar[3];
boolean brighter = true;
boolean dimmer = false;
dstars[0] = new DancingStar(0.3, dimmer);
dstars[1] = new DancingStar(0.3, dimmer);
@gescandon
gescandon / BatchScrambleUtil
Created May 28, 2015 13:35
Apex Data Scrambler
public without sharing class BatchScrambleUtil {
public static Set<Id> testDataOwnerIds;
static {
List<Test_Data_Owners__c> testOwners = Test_Data_Owners__c.getAll().values();
testDataOwnerIds = new Set<Id>();
for(Test_Data_Owners__c owner : testOwners) {
testDataOwnerIds.add(owner.Owner_Id__c);
}
}
@gescandon
gescandon / tooling.page
Created May 4, 2015 16:12
SFDC Tooling Explorer - Who touched the Code!
<apex:page id="thepage" sidebar="false" >
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/33.0/connection.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
var APEXCLASS_QUERY = "/?q=select+id,+Name,+lastmodifiedbyid,+lastmodifieddate+from+ApexClass";
var APEXPAGE_QUERY = "/?q=select+id,+Name,+lastmodifiedbyid,+lastmodifieddate+from+ApexPage";
@gescandon
gescandon / pngMapper
Created February 22, 2015 00:04
Ruby PNG to HeightMap Converter
require 'chunky_png'
# Convert a greyscale PNG file to a openscad heightmap data file
lheight = 0.3 # makerbot layer height
farg = Array.new
ARGV.each do|a|
farg << a
end
@gescandon
gescandon / 3d Cup
Created February 5, 2014 19:13
Openscad cup
ch = 40; //cup height
dt = 40; // top diameter
lipd = 3; // top lip: 7mm max
base = 5; // base
steps = 20; // parabola steps
db = dt - 2*lipd; // bottom diameter
ym = ch - base; // hollow depth
xpm = 2*lipd; // parabola width
xh = db - (2*xpm) + 1; // hollow cylinder width
@gescandon
gescandon / kochCurve.html
Last active December 27, 2015 19:49
Generate points on a Koch curve.
<!DOCTYPE>
<html>
<head>
<title>Koch Snowflake</title>
</head>
<script>
var K0 = [
[1,1], [11,1], [6, -8.66], [1,1]
]
@gescandon
gescandon / Koch Snowflake
Last active December 27, 2015 19:49
Openscad script for a koch snowflake.
k2 = [[1, 1],[2.1111111111111116, 1],[2.666666666666667, 1.9622504486493764],[3.2222222222222228, 1],[4.333333333333334, 1],[4.888888888888889, 1.9622504486493764],[4.333333333333334, 2.9245008972987527],[5.444444444444445, 2.9245008972987527],[6, 3.8867513459481287],[6.555555555555555, 2.9245008972987523],[7.666666666666667, 2.9245008972987527],[7.111111111111112, 1.9622504486493761],[7.666666666666667, 1],[8.777777777777779, 1],[9.333333333333334, 1.9622504486493761],[9.88888888888889, 1],[11, 1],[10.444444444444445, -0.07333333333333347],[11.096200600061966, -1.091125224324688],[9.88888888888889, -1.146666666666667],[9.333333333333334, -2.22],[9.985089488950853, -3.237791890991355],[11.192401200123928, -3.1822504486493766],[10.636845644568373, -4.255583781982709],[11.288601800185893, -5.273375672974065],[10.081290089012818, -5.3289171153160435],[9.525734533457262, -6.402250448649377],[8.873978377839741, -5.3844585576580215],[7.666666666666666, -5.44],[7.111111111111111, -6.513333333333334],[7.7628672667286
@gescandon
gescandon / SFDC Debug Log Parser
Last active July 20, 2020 13:07
SFDC Debug Log Parser - Ruby
#!/usr/bin/ruby
class Testoid
def initialize(saction, sname,ename, stime,etime)
@saction, @sname,@ename, @stime,@etime = saction,sname,ename, stime,etime
end
def getDelta
return etime.gsub(")","").to_i - stime.gsub(")","").to_i
end