Skip to content

Instantly share code, notes, and snippets.

View bhaity's full-sized avatar

Sikandar Shukla bhaity

View GitHub Profile
@bhaity
bhaity / gist:cafb9fb868f9fd12e44a338326fecfa9
Created September 6, 2024 00:27
v2 accounts postman collection 9/5
{
"info": {
"_postman_id": "9ba14c5d-9015-417d-afe3-08b6ba964195",
"name": "bapi-srv v2 accounts Copy",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
"_exporter_id": "37558999"
},
"item": [
{
"name": "Charges and Transfers",
@bhaity
bhaity / issue
Created August 28, 2024 22:33
Create Account endpoint not working
It should have done xxxx instead
Entry.objects.filter(
... headline__startswith='What'
... ).exclude(
... pub_date__gte=datetime.date.today()
... ).filter(
... pub_date__gte=datetime(2005, 1, 30)
... )
to_write.each_with_index do |(key, value), index|
to_write[key] = iptc_values[index]
end
i=0
to_write.each do |key,value|
to_write[key] = iptc_values[i]
i = i+1
end
to_write = {:date_created=>"", :time_created=>"", :name=>"", :by_line=>"", :city=>"", :state=>"", :country_primary_location_name=>"", :copyright_notice=>"", :sub_location=>"", :caption=>""}
iptc_values = ["2013:11:19", "20:48:57", "InStyle Editor Ariel Foxman Hosts a Cocktail Party to Welcome Eric Wilson as InStyle’s First Fashion News Director", "Billy Farrell/BFAnyc.com", "New York", "New York", "United States", "BFA NYC", "The Skylark, NYC", "Zac Posen, Vera Wang, Ariel Foxman, Karin Tracy"]
%x[exiftool -iptc:DateCreated="#{event.date_created}" -iptc:DigitalCreationDate="#{event.date_created}" -iptc:DigitalCreationTime="#{event.time_created}" -iptc:Headline="#{event.name}" -iptc:By-line="#{event.by_line}" -iptc:City="#{event.city}" -iptc:Province-State="#{event.state}" -iptc:Country-PrimaryLocationName="#{event.country_primary_location_name}" -iptc:CopyrightNotice="#{event.copyright_notice}" -iptc:Sub-location="#{event.sub_location}" -iptc:Caption-Abstract="#{people_string}" #{path}]
def zip(hash)
#this method takes a hash in the format {FIRST_PHOTO_ID => {:dpi=>INT,
# :watermark=>BOOL},
# SECOND_PHOTO_ID => {:dpi=>INT,
# :watermark=>BOOL} }
require 'zip/zip'
#new_hash_of_photos = {}
hash.each do |id, specs|
[{"created_at":"2012-10-18T16:10:36Z","id":664034,"person_id":73560,"photo_id":468190,"position":1908,"updated_at":"2012-10-18T16:10:36Z","person":{"created_at":"2012-10-18T16:10:36Z","id":73560,"name":"Daniel Best","photo_id":null,"title":null,"updated_at":"2012-10-18T16:10:36Z"}},{"created_at":"2012-10-18T16:10:40Z","id":664035,"person_id":73561,"photo_id":468190,"position":1909,"updated_at":"2012-10-18T16:10:40Z","person":{"created_at":"2012-10-18T16:10:40Z","id":73561,"name":"Percy Champman","photo_id":null,"title":null,"updated_at":"2012-10-18T16:10:40Z"}},{"created_at":"2012-10-18T16:10:45Z","id":664036,"person_id":73562,"photo_id":468190,"position":1910,"updated_at":"2012-10-18T16:10:45Z","person":{"created_at":"2012-10-18T16:10:45Z","id":73562,"name":"Hannibal Lecter","photo_id":null,"title":null,"updated_at":"2012-10-18T16:10:45Z"}},{"created_at":"2012-10-23T17:27:41Z","id":664044,"person_id":73548,"photo_id":468190,"position":1918,"updated_at":"2012-10-23T17:27:41Z","person":{"created_at":"2012-09-2