Skip to content

Instantly share code, notes, and snippets.

View doapp-ryanp's full-sized avatar

Ryan Pendergast doapp-ryanp

View GitHub Profile
@doapp-ryanp
doapp-ryanp / cloudformation.json
Created January 15, 2015 17:01
AWS CloudFormation for CodeDeploy
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Webservices",
"Parameters": {
"aaPrefix": {
"Type": "String",
"Default": "prod"
},
"ProjectName": {
"Type": "String",
@doapp-ryanp
doapp-ryanp / osticket.conf
Last active August 29, 2015 14:01
osticket.conf
server {
server_tokens off;
listen 80 default_server;
server_name tickets.me.com;
client_max_body_size 5M;
keepalive_timeout 0;
fastcgi_read_timeout 120;
fastcgi_send_timeout 60;
@doapp-ryanp
doapp-ryanp / gist:9687011
Last active August 29, 2015 13:57
versions for capistrano osx
ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin13.0.2]
cap --version
Capistrano v2.15.5
gem query --local
*** LOCAL GEMS ***
@doapp-ryanp
doapp-ryanp / gist:6011897
Created July 16, 2013 19:35
geddy cors
this.before(function(){
var res = this.response;
if ('OPTIONS' == this.request.method) {
res.setHeaders(200,{
'Content-Type': 'text/plain',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With',
'Access-Control-Max-Age': 5184000 //2 months
@doapp-ryanp
doapp-ryanp / gist:4595068
Created January 22, 2013 14:34
configure spotify for linux shortcut keys
#@see rynop.com for details
sudo apt-get install xbindkeys
####now put the following in ~/.xbindkeysrc:
#KeyboardPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
XF86AudioPlay
#KeyboardStop
@doapp-ryanp
doapp-ryanp / gist:2769047
Created May 22, 2012 13:27
dynamo exception class
class DynamoDbException extends Exception
{
//DyanmoDB exceptions. @see http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/ErrorHandling.html
const AccessDeniedException = 1;
const ConditionalCheckFailedException = 2;
const IncompleteSignatureException = 3;
const LimitExceededException = 4;
const MissingAuthenticationTokenException = 5;
const ProvisionedThroughputExceededException = 6;
const ResourceInUseException = 7;
~/hubot$ ~/hubot/bin/hubot -a hipchat -n Hubot
npm http GET https://registry.npmjs.org/hubot-hipchat
npm http GET https://registry.npmjs.org/hubot/2.1.4
npm http GET https://registry.npmjs.org/hubot-scripts
npm http GET https://registry.npmjs.org/optparse/1.0.3
npm http 304 https://registry.npmjs.org/hubot/2.1.4
npm http 304 https://registry.npmjs.org/hubot-hipchat
npm http 304 https://registry.npmjs.org/hubot-scripts
npm http 304 https://registry.npmjs.org/optparse/1.0.3
npm http GET https://registry.npmjs.org/wobot/0.6.0
~/hubot# bin/hubot
npm http GET https://registry.npmjs.org/hubot-hipchat
npm http 304 https://registry.npmjs.org/hubot-hipchat
npm http GET https://registry.npmjs.org/wobot/0.6.0
npm http 304 https://registry.npmjs.org/wobot/0.6.0
npm http GET https://registry.npmjs.org/node-xmpp
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/node-xmpp
npm http 304 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/node-expat
:~/hubot# cat package.json
{
"name": "hosted-hubot",
"version": "2.1.4",
"author": "GitHub Inc.",
"keywords": "github hubot campfire bot",
"description": "A simple helpful Robot for your Company",
"licenses": [{
"type": "MIT",
"url": "http://github.com/github/hubot/raw/master/LICENSE"
@doapp-ryanp
doapp-ryanp / gist:1364489
Created November 14, 2011 17:17
Manual Imagick crop via gravity
<?php
$this->imgMetadata['format'] = strtolower($this->imagickObj->getImageFormat());
$this->imgMetadata['width'] = $this->imagickObj->getImageWidth();
$this->imgMetadata['height'] = $this->imagickObj->getImageHeight();
$x = $y = 0;
switch ($gravity) {
case 'center':
// $gravity = \Imagick::GRAVITY_CENTER;
$x = ($this->imgMetadata['width']/2) - ($width/2);