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
@bkenny
bkenny / test2.json
Created March 31, 2015 14:12
test2.json
{
"activity_feed": [
{
"action": "content_like",
"activity_details": [
{
"action": "content_like",
"activity_details": {
"content": {
"activated": true,
{
"95": [
{
"action": "content_retag",
"created_at": 1426689199,
"id": 5,
"object_id": 12279,
"updated_at": 1426689199,
"user_id": 95
},
@bkenny
bkenny / Location_API.markdown
Last active August 29, 2015 14:09
What would be useful in a location API?

What would be useful in a location API?

If you hit an API with e.g. "Dublin", what would be the best response to get back from an API?

  • Full Address (Dublin, Co.Dublin, Ireland)
  • Weather forcast over the next 3 days
  • Introduction to the city (Wikipedia)
  • Time offset (GMT +0)
  • Population
  • Nearest Airport
  • Nearest Ferry
@bkenny
bkenny / MiniPeek.md
Last active August 29, 2015 14:04
MiniPeek Questions

MiniPeek Interview

Photos

  1. Profile Screenshot Please send us the most high resolution profile photo that you love. Ideally we'd love a resolution of 1800x800 or higher.

  2. Smartphone Screenshot Please send us a screenshot of your smartphones home screen.

Questions

@bkenny
bkenny / base64_encode.rb
Created August 21, 2013 12:58
Quickly encode a file in ruby to base64
require 'base64'
# Open the file you wish to encode
data = File.open('/Users/bkenny/Desktop/d3cce16ee41411e296c022000a1f980f_101.mp4').read
# Encode the puppy
encoded = Base64.encode64(data)
# Spit it out into one continous string
puts encoded.gsub(/\n/,"")
@bkenny
bkenny / db-backup.sh
Created July 1, 2013 13:40
Simple bash script to zip all mysql dbs and back them up to S3
#!/bin/bash
BACKUP="/tmp/s3/db"
DATE=`date +"%Y-%m-%d"`
DIR="${BACKUP}/${DATE}/"
if [ ! -d $DIR ];
then
mkdir -p $DIR
fi
@bkenny
bkenny / spots_popular_tweet.rb
Created March 26, 2013 13:51
Post a tweet with the most popular Spot from yesterday - http://www.spots.io
@bkenny
bkenny / gist:5031375
Last active December 14, 2015 04:49
Grab products where tag like
@products = Product.where(:source => params[:vendor], :city => params[:location]).includes(:tags).where(['tags.title LIKE ?', @tag.title])
## 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];