Skip to content

Instantly share code, notes, and snippets.

View mtetlow's full-sized avatar

Mike "Mikename" Tetlow mtetlow

  • AscendX
  • Denver CO
View GitHub Profile
@mtetlow
mtetlow / how_to_parse_this.java
Last active October 28, 2019 23:32
ConnectApi.SmartDataDiscovery API
ConnectApi.SmartDataDiscoveryPredictInputRecords input = new ConnectApi.SmartDataDiscoveryPredictInputRecords();
input.predictionDefinition = '0ORf0000000xxxxxxx';
input.records = new List<Id>{'a291Y000002Exxxxxxx'};
ConnectApi.SmartDataDiscoveryPrediction request =
ConnectApi.SmartDataDiscovery.predict(input);
// Everything up to here so far so good
System.debug('ConnectApi.SmartDataDiscoveryPrediction');
System.debug(JSON.serializePretty(request));
@mtetlow
mtetlow / gist:2775527
Created May 23, 2012 14:31 — forked from stackdump/gist:1479007
List local memcached keys using Ruby
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids += matches
end