Skip to content

Instantly share code, notes, and snippets.

View dbgrandi's full-sized avatar

David Grandinetti dbgrandi

View GitHub Profile
@dbgrandi
dbgrandi / gems.txt
Created December 19, 2018 04:05
AWS Ruby Lambda Gems
aws-eventstream (1.0.1)
aws-partitions (1.117.0)
aws-sdk (3.0.1)
aws-sdk-acm (1.14.0)
aws-sdk-acmpca (1.7.0)
aws-sdk-alexaforbusiness (1.13.0)
aws-sdk-amplify (1.0.0)
aws-sdk-apigateway (1.23.0)
aws-sdk-applicationautoscaling (1.16.0)
aws-sdk-applicationdiscoveryservice (1.8.0)
@dbgrandi
dbgrandi / public_diff.rb
Created February 23, 2016 02:33
Script I use to check public API diffs between pod specs
#!/usr/bin/env ruby
require 'cocoapods'
def get_public_changes_between_versions(path, podspec, old_tag, new_tag)
pathlist = Pod::Sandbox::PathList.new(Pathname.new(path))
headers = []
spec = Pod::Specification.from_file podspec
# https://github.com/CocoaPods/cocoadocs.org/issues/35
@dbgrandi
dbgrandi / getFilesAndDirs.m
Last active December 27, 2015 17:09
Here's a version that parses out the files and directories using Hpple.
#import "AFNetworking.h"
#import "TFHpple.h"
NSString *baseURLString = @"http://gd2.mlb.com/components/game/mlb/year_2013/month_06/day_01/gid_2013_06_01_wasmlb_atlmlb_1/";
NSMutableArray *files = [@[] mutableCopy];
NSMutableArray *dirs = [@[] mutableCopy];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:baseURLString]];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
@dbgrandi
dbgrandi / aliases
Created July 21, 2011 13:26
git aliases for bash
#
# my current git aliases for bash.
# i'm using git-achievements, if you are not, just leave that one out
#
alias g='git'
alias ga='git add'
alias gb='git branch -a -v'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
@dbgrandi
dbgrandi / building Io
Created March 20, 2011 02:36
does not like libevent 2.0.10?
dave@crowbar ~/projects/watched/stevedekorte/io (master) $ ./build.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
@dbgrandi
dbgrandi / hoptoad greasemonkey
Created February 24, 2011 13:33
make hoptoad errors link directly to textmate
// ==UserScript==
// @name Hoptoad Textmate Backtrace
// @namespace hoptoad
// @description Add textmate links to application stacktrace lines on error pages
// @include https://YOURACCOUNT.hoptoadapp.com/errors/*
// ==/UserScript==
//
// based on original script from http://userscripts.org/scripts/show/63465
// with much help from @orta
# Add this to line 86 on git-achievements
# ruby basecamp.rb "`git config user.name`" "$@" "$2"
# then create a file called basecamp.rb with the rest of this file in it
#!/usr/bin/env ruby
require 'rubygems' rescue nil
require 'broach'
@dbgrandi
dbgrandi / install_homebrew.rb
Created March 29, 2010 23:45 — forked from mxcl/install_homebrew.markdown
Check if user is in staff group before installing homebrew
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 30th March 2010:
@dbgrandi
dbgrandi / netservices_macruby.rb
Created November 9, 2009 11:15 — forked from voodootikigod/netservices_macruby.rb
Using the NSNetServiceBrowser with macruby
delegate = Object.new
def delegate.netServiceBrowserWillSearch(browser)
puts "search commencing!"
end
def delegate.netServiceBrowser(browser, didFindService:service, moreComing:more)
# this never calls regardless of the services on the network.
puts "Found service #{service.name}."
end
#!/usr/bin/env ruby
#
# grab a full copy of all my github code.
#
# assumptions: github.user and github.token are set in git
#
require 'yaml'
user = `git config --get github.username`.strip