Skip to content

Instantly share code, notes, and snippets.

View mikegreiling's full-sized avatar

Mike Greiling mikegreiling

View GitHub Profile
@mikegreiling
mikegreiling / github_issue_stats_webtask.js
Created January 29, 2016 04:03
A simple Auth0 webtask (webtask.io) for IFTTT which saves GitHub issue ages indexed by issue label(s) upon issue close
var moment = require('moment');
var parallel = require('async').parallel;
var MongoClient = require('mongodb').MongoClient;
function update_label_stats(label, age, db, cb) {
var where = {
label: label
};
var update = {
@mikegreiling
mikegreiling / gcal-backup.sh
Last active August 29, 2015 14:11
Simple cron script to backup a Google Calendar to Amazon S3 (http://pixelcog.com/blog/2014/backup-gcal-to-s3/)
#!/bin/sh
export TZ=America/Chicago
export PATH=/usr/local/bin:$PATH # ensure path to aws exists for chrontab
# uncomment if needed
#export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST
#export AWS_SECRET_ACCESS_KEY=1234567890ABCDEFGHIJKLMNOPQRSTUV
bucket="my-bucket-name"
gcal_private_key="example.com_b6nffmu1v5v4jehogm9v5anll4%40group.calendar.google.com/private-4463bc3c4777e7d435cc385f9b3573a0"
@mikegreiling
mikegreiling / bookmarklet.js
Last active August 29, 2015 14:04
Xdebug Toggle Bookmarklet (With WebKit Notifications)
/*
Adapted from http://pollinimini.net/blog/xdebug-bookmarklet/
WebKit notifications added
©2014 PixelCog Inc. MIT License
*/
(function() {
var idekey = '',
minutes = 10,
exp = new Date(),
@mikegreiling
mikegreiling / opsworks-agent-downloader.py
Created July 8, 2014 21:27
Download all available versions of aws 'opsworks-agent-installer.tgz' for examination
#!/usr/bin/env python
import os, time, urllib2, shutil, urlparse
def main():
for version in range(450):
try:
url = 'https://opsworks-instance-agent.s3.amazonaws.com:443/%d/opsworks-agent-installer.tgz' % version
filename = 'opsworks-agent-installer-%03d.tgz' % version
download(url, filename)
@mikegreiling
mikegreiling / attributes.json
Created May 8, 2014 07:34
AWS OpsWorks Deploy - Attribute Dump
{
"opsworks": {
"activity": "deploy",
"sent_at": 1399533119,
"deployment": "33cb5d91-27c8-4e71-9d3e-e7925e5caa03",
"layers": {
"php-app": {
"name": "PHP App Server",
"id": "73271990-452b-4e5f-8a71-619e6441a447",
"elb-load-balancers": [
@mikegreiling
mikegreiling / GitInfo.php
Created February 5, 2013 18:08
git parser class and example usage...
<?php
/**
* ArkOwl Fraud Verification Service
*
* @copyright Copyright 2012, ArkOwl LLC. (http://arkowl.com) All Rights Reserved
*/
namespace app\extensions;
class GitInfo {
@mikegreiling
mikegreiling / StripeTutorialPage.html
Created October 11, 2012 05:02 — forked from boucher/StripeTutorialPage.html
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below