Skip to content

Instantly share code, notes, and snippets.

View plashchynski's full-sized avatar
🎯
Focusing

Dzmitry Plashchynski plashchynski

🎯
Focusing
View GitHub Profile
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@mjul
mjul / 02_nginx_gzip_configuration.config
Last active November 6, 2020 03:29
Enable gzip compression in Elastic Beanstalk Docker nginx proxy (add to .ebextensions folder)
files:
"/etc/nginx/conf.d/gzip.conf":
mode: "644"
owner: "root"
group: "root"
content: |
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
@plashchynski
plashchynski / google_play_purchase_verification.rb
Last active August 29, 2015 14:16
Android Google Play In-App purchases verification in Ruby
module Android
def self.verify_purchase(receipt_data, signature)
android_inapp_public_key = Rails.application.secrets[:android_inapp_public_key]
public_key = OpenSSL::PKey::RSA.new(Base64.decode64(android_inapp_public_key))
unless public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), receipt_data)
raise "Wrong Android payment"
end
end
end
@vinhnx
vinhnx / ios_toolbox.md
Last active August 26, 2023 08:06
my iOS development toolbox

http://www.mkdown.com/8704724

Prologue

Software development, especially mobile development has been improving rapidly. Nowadays, they are things that are unthinkable as of several years ago.

The world is moving to mobile. And as a (newbie) mobile software/iOS developer, I think there're always many thing for us to learn everyday.

Being able to keep track of what's new in technology today is really difficult, it's daunting, not to say an impossible task; but we can't help but have to keep being updated, unless we want to be left behind.

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 6, 2024 12:37
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'