Skip to content

Instantly share code, notes, and snippets.

View bkenny's full-sized avatar
💭
Shipping Products

Brian Kenny bkenny

💭
Shipping Products
View GitHub Profile
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
- (void)locationReceived:(NSNotification *)notif {
InstaLocation *location = (InstaLocation*)[notif object];
[instagramVenues addObject:location];
[fsToInstagramVenues setObject:location.foursquareId forKey:location.locationId];
for (MediaData *mediaData in location.images) {
responseCount++;
[feedImages addObject:mediaData];
mediaData.locationName = location.name;
[NSSortDescriptor sortDescriptorWithKey:@"created_time" ascending:YES];
@bkenny
bkenny / gmaps_autocomplete.html
Created December 18, 2012 14:03
Google Maps V3 Autocomplete Field
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script>
function initialize() {
var input = document.getElementById('searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input);
}
google.maps.event.addDomListener(window, 'load', initialize);
@media only screen and (min-width: 1024px) {
/* Add your custom styles here for Desktop */
}
@media only screen and (max-width: 1023px) {
/* Add your custom styles here for Tablet */
}
@media only screen and (max-width: 640px) {
/* Add your custom styles here for Large Mobile */
@bkenny
bkenny / code_generator.rb
Created November 25, 2015 11:48
Generate unique codes in a CSV
require 'bazaar'
require 'rails'
require "csv"
tokens_array = []
array_complete = false
while array_complete == false do
token = Bazaar.object
tokens_array << token unless tokens_array.include?(token)
Processing by ViewsController#image as */*
Processing by ViewsController#image as HTML
@bkenny
bkenny / messing.rb
Created July 9, 2012 11:41
Foursquare API
require 'json'
require 'httparty'
require 'geocoder'
require 'foursquare2'
require 'hashie'
@@client = Foursquare2::Client.new(:client_id => 'PQPTTYWDIXOYHUYJMO0UX30W1VI0Q3IHXC314QSA50VMZDNB', :client_secret => 'AIUV3COEJRQOMDUQXEFXN0X5LPRSEP1P43TLNMN00RQ30U4H')
def show_subcategories
@bkenny
bkenny / mongoimport.rb
Created May 14, 2012 14:48
Import MiniCorp Blog into Mongo DB
require 'rubygems'
require 'mongo'
require 'net/http'
require 'active_support/core_ext'
require 'crack'
require 'uri'
require 'hashie'
def convert(feed)
db = Mongo::Connection.new.db("blogs")
@bkenny
bkenny / cro.rb
Created April 29, 2012 15:39
CRO API Services
# CRO API Access by @bkenny
#
# Example, to search for a company use: CRO.new(email_address, api_key).companies("Starbucks")
# To search for a companies submissions: CRO.new(email_address, api_key).submissions("315499", "c")
require 'rubygems'
require 'httparty'
require 'hashie'
class CRO
@bkenny
bkenny / hack.sh
Created April 4, 2012 13:28 — forked from davidjrice/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#