Skip to content

Instantly share code, notes, and snippets.

View Gerg's full-sized avatar

Greg Cobb Gerg

View GitHub Profile
@Gerg
Gerg / README.md
Last active August 29, 2015 13:56
Set HipChat display name when using Git-Pair

Git Pair + HipChat

This script makes your git pair automatically update the display name for your workstation's HipChat account.

Dependencies

  1. You need a (HipChat)[https://www.hipchat.com/] account for each workstation
  2. You need to have (git pair)[https://github.com/pivotal/git_scripts] set up

Setup

  1. Install hipchat-api gem gem install hipchat-api
@Gerg
Gerg / README.md
Last active August 29, 2015 13:56
Example Custom Jasmine Matchers

Example Custom Jasmine Matchers

Note: Some matchers require underscore.js and/or jQuery.

General Purpose Matchers

  • toHaveElement
  • toContainText
  • toContainTranslation
  • toHaveLength
@Gerg
Gerg / README.md
Last active August 29, 2015 13:56

Git Pair Timeout

Simple pre-commit hook to block commits if you haven't paired in the last 9 hours.

Setup

  1. Add the correct path to your .gitconfig file on line 5
  2. Put the script in your repo's .git/hooks/ directory
Acknowledgments

Built at Pivotal Labs

@Gerg
Gerg / README.md
Last active August 29, 2015 13:56 — forked from sheelc/README.md

Jasmine 2 Phantom Runner

Use to run your Jasmine 2 specs using phantom.js. Useful for running your tests in your console or CI.

Setup:

  1. Download phantom_runner.js and put it in your project
  2. Include the phantom_callback.html snippet in your SpecRunner.html after other Jasmine files are included

To use:

### Keybase proof
I hereby claim:
* I am gerg on github.
* I am gcobb (https://keybase.io/gcobb) on keybase.
* I have a public key whose fingerprint is 3AD0 4F45 DF0C 3C20 43E8 D196 50F0 D2CE B363 B6CF
To claim this, I am signing this object:
@Gerg
Gerg / user_array.rb
Last active July 15, 2020 18:39
Acceptance script for CAPI user testing
#!/usr/bin/env ruby
require 'pp'
SCOPE_USERS = {
admin: 'admin',
admin_read_only: 'admin_read_only',
global_auditor: 'global_auditor',
}
#!/usr/bin/env ruby
require 'rspec'
require 'open3'
require 'json'
require 'cgi'
RESOURCE_ENDPOINT = '/v3/routes'
RESOURCE_BODY = {
'host': '<random>',
@Gerg
Gerg / auto_pm.py
Created January 14, 2020 19:49
Automatic PM for VAT
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Instructions
# chmod +x auto_pm.py
# ./auto_pm.py
import json
import random
import base64
#!/usr/bin/env ruby
require 'date'
require 'open3'
class Main
class << self
def resources
%w[apps]
end
#!/usr/bin/env ruby
require 'date'
require 'open3'
class Main
class << self
def resources
%w[
app_usage_events