Skip to content

Instantly share code, notes, and snippets.

View conarro's full-sized avatar

Kyle Conarro conarro

View GitHub Profile
@conarro
conarro / campsite.yml
Created September 17, 2024 10:33
GitHub Pull Request → Campsite Post (via GitHub Actions)
name: "🏕️ Campsite"
on:
pull_request:
types: [opened]
branches: [ "main" ]
jobs:
notify-campsite:
runs-on: ubuntu-latest
@conarro
conarro / tokens.py
Last active December 19, 2015 00:05
Tokens for variable substition using Splunk REST API modular input
from datetime import datetime, timedelta
# imports the required python libs
# helper function to get the end of the most recent hour
# as a python datetime object
#
# e.g. if the script calls this on 12/18 at 16:05
# this returns a python date object for 12/18 at 15:59:59
#
def most_recent_hour_end():
return datetime.now().replace(minute=59, second=59, microsecond=0)
@conarro
conarro / user-extensions.js
Created December 30, 2014 15:20
Sample Selenium IDE User Extension
Selenium.prototype.doTypePassword = function(locator, text) {
/**
* Sets the value of an input field the provided text
*
* @param locator an <a href="#locators">element locator</a>
*/
// All locator-strategies are automatically handled by "findElement"
var element = this.page().findElement(locator);
this.browserbot.replaceText(element, text);
@conarro
conarro / inventory.rb
Created March 27, 2014 19:32
AWS EC2 Inventory script
#!/usr/bin/ruby
require 'dotenv'
require 'aws'
require 'csv'
# patch instance to return runtime
class AWS::EC2::Instance
def runtime
@runtime ||= Time.now - launch_time