- Zero Downtime
- Graceful shutdowns
- Via Github Actions
- Zero infrastructure management overhead
The general idea is to have Github Actions test, build and deploy a Rails app to Google Cloud Compute Engine.
##Longest Substring with At Most K Distinct Characters | |
var lengthOfLongestSubstringKDistinct = function(s, k) { | |
//incase the length of the string is the same or less than the distict number then return the length of the string. | |
if(k >= s.length ){ | |
return s.length; | |
} | |
//define an empty hash map variable. | |
let hmap = {} | |
let max = 0; | |
//iterating through the string. |
# connect to mail server using IMAP | |
client = ImapClient("imap.gmail.com", 993, "username", "password") | |
# select folder | |
client.select_folder("Inbox") | |
# loop through email messages and save them as .eml files | |
for msg in client.list_messages(): | |
print("Subject: " + msg.subject) | |
print("HtmlBody: " + msg.html_body) |
⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.
This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.
See Contributing.
For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):
List All System Images Available for Download: sdkmanager --list | grep system-images
Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"
sentry
SENTRY_SECRET_KEY
to random 32 char stringdocker-compose up -d
docker-compose exec sentry sentry upgrade
to setup database and create admin userdocker-compose exec sentry pip install sentry-slack
if you want slack plugin, it can be done laterdocker-compose restart sentry
9000
# Open django shell and do following. | |
import urls | |
def show_urls(urllist, depth=0): | |
for entry in urllist: | |
print(" " * depth, entry.regex.pattern) | |
if hasattr(entry, 'url_patterns'): | |
show_urls(entry.url_patterns, depth + 1) |
import android.app.Application; | |
import android.text.TextUtils; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.toolbox.ImageLoader; | |
import com.android.volley.toolbox.Volley; | |
public class AppController extends Application { |