Skip to content

Instantly share code, notes, and snippets.

@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 14, 2024 19:26
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@slintak
slintak / _README.md
Last active May 14, 2024 19:23
Meshtastic AI Chat Assistant Integration

This gist contains a proof of concept project (hacked together during one evening) aimed at connecting an AI chat assistant to the Meshtastic network, enhancing its capabilities. The assistant is designed to provide concise and helpful responses within the constraints of the Meshtastic environment.

Project Overview:

This project brings together two favorite elements: the Meshtastic network and an AI chat assistant. The assistant is based on the "FuseChat-7B-VaRM-Q5_K_M" model, and the code is written in Python.

@briankung
briankung / 00.md
Last active May 14, 2024 19:20
[RFC] Making sense of secure token authentication in Rails

/ be me

/ be working on new Rails API web app

/ ...I can't. I hate this format

...so I was looking up how to do simple, secure authentication in Rails for my super secret project which you definitely can't find by looking at recent activity on my [GitHub account] (Hail [Mammon][[0][zero]]) and realized that I hadn't implemented authentication in Rails in a long time. The closest I'd come to was throwing [Devise] into my app and grumpily remembering to configure the mailer after the fact.

This will seem unrelated, but bear with me: I learned how to calculate interest rates on loans in something like 6th grade. I have since forgotten how to do that without assistance. Much like how I would have been much better prepared to choose a mortgage back then, I would in some ways be much better prepared to figure out authentication a few years ago when I was just starting out in web dev - and had just implemented it from the [Hartl tutorial]. That said, just like how I now know more of what I'm looking for

@Theigrams
Theigrams / clash_api.py
Created November 18, 2023 16:04
Clash API controlled through Python
import json
import requests
class ClashAPI:
def __init__(self, base_url, secret):
self.base_url = base_url
self.secret = secret
self.headers = {
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 14, 2024 19:17
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@ndeadly
ndeadly / sysmodules.txt
Last active May 14, 2024 19:14
switch sysmodules
/* Nintendo sysmodules */
0100000000000000 fs
0100000000000001 ldr
0100000000000002 ncm
0100000000000003 pm
0100000000000004 sm
0100000000000005 boot
0100000000000006 usb
0100000000000007 tma.stub/htc.stub
0100000000000008 boot2
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 14, 2024 19:12
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 14, 2024 19:11
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@KazaiMazai
KazaiMazai / CollectionView.swift
Last active May 14, 2024 19:09
Better SwiftUI wrapper for UICollectionView
import SwiftUI
extension CollectionView {
typealias UIKitCollectionView = CollectionViewWithDataSource<SectionIdentifierType, ItemIdentifierType>
typealias DataSource = UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>
typealias Snapshot = NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>
typealias UpdateCompletion = () -> Void
}
struct CollectionView<SectionIdentifierType, ItemIdentifierType>
@vasanthk
vasanthk / System Design.md
Last active May 14, 2024 19:08
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?