Skip to content

Instantly share code, notes, and snippets.

View bpietraga's full-sized avatar
👋
Hello

Bernard Pietraga bpietraga

👋
Hello
View GitHub Profile

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@bpietraga
bpietraga / preorder_search.py
Last active July 20, 2023 21:48
Binary Tree Practice from udacity
class Node(object):
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree(object):
def __init__(self, root):
self.root = Node(root)
Dir['*'].each { |f| old_name = File.basename(f, '.*'); new = File.basename(f).gsub('front_name_', '').gsub(/\./, '_ending_name.'); File.rename(f, new) }
require 'base64'
require 'net/http'
require 'uri'
require 'openssl'
require 'json'
class MessageExchange
def initialize(url)
@uri = URI(url)
@cipher_key = 'this_key_have_to_equal_32_bytes!'