Skip to content

Instantly share code, notes, and snippets.

View mccrackend's full-sized avatar
🦊

Dan McCracken mccrackend

🦊
View GitHub Profile
@mccrackend
mccrackend / gist:b9790d69337cec3da333c834971a50a7
Last active June 26, 2021 14:01
DevsOperative Days - Rpi Setup
Step 1 - Flash the SSD with an operating system
Official RaspberryPi.org Imager Tool
https://bit.ly/3qmmmOd
Step 2 - Power On, Change Hostnames, Assign Static IPs
ssh ubuntu@<Initial_IP_Address>
sudo vim /etc/hostname
sudo reboot now
@mccrackend
mccrackend / Calculated InitialExpression
Created October 10, 2011 20:00
Using a calculated value for a property's InitialExpression. Written in Intersystems Cache Object Script.
...class definition
/// Set InitialExpression to any class method returning the calculated value.
/// In this case, I'm returning a string value.
Property BaseDirectoryPath As %String [ InitialExpression = {..GetBaseDirectoryForNamespace()} ];
/// Returns the base directory path to use for whatever cache instance the class is being used in.
ClassMethod GetBaseDirectoryForNamespace() As %String
{
SET vPath = $CASE($Namespace,
@mccrackend
mccrackend / Using %ResultSet.SQL
Created December 17, 2010 15:29
Using %ResultSet.SQL Objects for query results. Written in Intersystems Cache Object Script.
ResultSetSample()
// Build query string
Set sql = "Select Value, DateTimeStamp From Spectrum_Support_Metrics.EnsPerformanceMetricsData Where " _
"CheckType = 'datasize' AND " _
"Detail = '/ensemble/mgr/PROD/' AND " _
"DateTimeStamp > '201012170930'"
// Create new resultSet object to work with called "rs". It's basically a cursor.
// This %Prepare command executes the query contained in "sql", sets the result to "rs", and gives an "error" flag back.
Set rs = ##class(%ResultSet.SQL).%Prepare(sql,.error,"")