Skip to content

Instantly share code, notes, and snippets.

View ridem's full-sized avatar

Ridem ridem

  • Paris/Stockholm
View GitHub Profile
@williamli
williamli / hongkong_districts_ups.json
Last active June 16, 2022 08:28
102 Hong Kong Districts (UPS) in JSON with Traditional Chinese Translation
// UPS District and Codes for Hong Kong, extracted from UPS Shipping Package Developer Kit PDF
[
{
"name": "Aberdeen",
"translations": {
"zh": "香港仔"
},
"code": "SD1"
},
@rcknr
rcknr / README.md
Last active July 19, 2018 12:36
Using Let's Encrypt certificates with Amazon API Gateway

##Using Let's Encrypt certificates with AWS API Gateway

Before starting off with API Gateway set up it's worth mentioning that certificate configuration for this particular service is so far isn't well integrated, therefore different from other AWS services. Despite it using CloudFrount to serve on custom domains it won't let you customize distributions it creates, however all the limitations of CloudFront naturally apply to API Gateway. The most important in this case is the size of the key, which is limited by 2048 bit. Many tutorials provide ready to use terminal commands that have the key size preset at 4096 bit for the sake of better security. This won't work with API Gateway and you'll get an error message about certificate's validity or incorrect chain which won't suggest you the real cause of the issue. Another consideration is that to add a custom domain to API Gateway you have to have a certif

@endymion
endymion / contact.rb
Last active February 18, 2024 22:49
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end