Skip to content

Instantly share code, notes, and snippets.

@fahim
fahim / keybase.md
Last active September 16, 2019 15:32

Keybase proof

I hereby claim:

  • I am fahim on github.
  • I am fahimff (https://keybase.io/fahimff) on keybase.
  • I have a public key ASBKjKAvFng6pp11xYdpYlBZSGlpyUgCXsRGmvZmQfwqQAo

To claim this, I am signing this object:

predictions2:[tiny_model.YOLO.Prediction(classIndex: 64, score: 0.2058498, rect: (4.923440456390381, 110.54672241210938, 8.238839149475098, 23.25177764892578))]
predictions1:[tiny_model.YOLO.Prediction(classIndex: 76, score: 0.275987, rect: (313.4144592285156, 105.02900695800781, 68.61804962158203, 76.11583709716797)), tiny_model.YOLO.Prediction(classIndex: 76, score: 0.23047142, rect: (315.76300048828125, 99.44351959228516, 88.4737548828125, 84.24098205566406))]
predictions2:[tiny_model.YOLO.Prediction(classIndex: 76, score: 0.22081207, rect: (333.34234619140625, 121.0230484008789, 26.151573181152344, 53.37668991088867))]
predictions1:[tiny_model.YOLO.Prediction(classIndex: 76, score: 0.31186736, rect: (313.2337646484375, 105.97148132324219, 68.92866516113281, 75.12811279296875)), tiny_model.YOLO.Prediction(classIndex: 76, score: 0.25417793, rect: (314.6299743652344, 101.06626892089844, 90.70462799072266, 81.71521759033203))]
predictions2:[]
predictions1:[tiny_model.YOLO.Prediction(classIndex: 76, score: 0.
@fahim
fahim / transfer.sh
Created February 17, 2016 04:33
how to copy from production to staging on heroku
heroku plugins:install https://github.com/ddollar/heroku-pg-transfer
heroku pg:transfer -f `heroku config:get DATABASE_URL --app production` -t `heroku config:get DATABASE_URL --app staging`
module CachedAttributes
#
# CachedAttributes creates convenience class methods to save DB query
# Retailer.allow_alcohol?(1) == Retailer.find(1).allow_alcohol
#
# class Retailer
# include CachedAttributes
# cache_boolean :allow_alcohol
# end
#
url = require('url')
querystring = require('querystring')
eventActions = require('./event-actions/all')
eventTypes = ["push"]
github = require('octonode')
client = github.client(process.env['HUBOT_GITHUB_ACCESS_TOKEN'])
repoName = process.env['HUBOT_GITHUB_MIGRATION_REPO']
repo = client.repo(repoName)
def details
original_details = read_attribute(:details)
value = original_details.blank? ? product.try(:details) : original_details
value ||= ""
if alcohol_by_volume.present?
variations = ["#{alcohol_by_volume}%", "#{alcohol_by_volume}0%"]
variations << "#{alcohol_by_volume.to_i}%" if alcohol_by_volume % 1 == 0.0
unless variations.any? { |variation| value.to_s.include?(variation.to_s) }
value += " #{alcohol_by_volume}% alcohol by volume."
{"tags"=>
{"title"=>"Mission Statement (Prod by Kutt The Check) (DatPiff Exclusive)",
"album"=>"No Genre 2",
"artist"=>"B.o.B",
"year"=>"null",
"v1"=>
{"title"=>"null",
"artist"=>"null",
"album"=>"null",
"year"=>"null",
config.action_mailer.smtp_settings = {
:user_name => ApplicationConfig.sendgrid_username,
:password => ApplicationConfig.sendgrid_password,
:domain => 'yammer.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
@fahim
fahim / gist:4997373
Created February 20, 2013 17:36
new obj-c syntax fail (or maybe im just using it wrong)
NSDictionary *songDict = @{@"artists": [item valueForProperty: MPMediaItemPropertyArtist],
@"title": [item valueForProperty: MPMediaItemPropertyTitle]};
// ----------- vs ---------- //
// the new syntax above caused a memory error. i ended up just using the old syntax below and the code worked fine
// ----------- vs ---------- //
NSDictionary *songDict = [[NSDictionary alloc] initWithObjectsAndKeys:
[item valueForProperty: MPMediaItemPropertyTitle], @"title",
[item valueForProperty: MPMediaItemPropertyArtist], @"artists",
#!/bin/env ruby
# encoding: utf-8
module Normalizers
class SongDataNormalizer
# def initialize(object)
# @object = object
# @tags = {}
# end