Skip to content

Instantly share code, notes, and snippets.

@robulouski
robulouski / gmail_imap_dump_eml.py
Last active January 7, 2025 08:56
Very simple Python script to dump all emails in an IMAP folder to files.
#!/usr/bin/env python
#
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
#
# RKI Nov 2013
#
import sys
import imaplib
import getpass
@CandyMi
CandyMi / README.md
Last active January 7, 2025 08:55
微信支付Lua SDK

微信支付Lua SDK

接口列表

  1. order 查询订单状态、关闭订单

  2. native/micro/h5 扫码支付、付款码支付、H5支付等等接口

  3. banks 银行卡对应表中文

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 7, 2025 08:55
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@rajeshkumaravel
rajeshkumaravel / steps.md
Created December 7, 2023 13:38
Installing a Font in WSL (Windows Subsystem for Linux)

Installing a Font in WSL (Windows Subsystem for Linux)

To install a font in WSL, follow these steps:

  1. Check Font Location: Confirm that the font file (e.g., VictorMono.ttf) is located in a directory accessible from your WSL instance. You can copy the font file to your WSL home directory for simplicity.

  2. Install Font: You can use the fc-cache command to update the font cache in WSL and make the font available. Open a terminal in your WSL instance and run the following commands:

sudo cp /mnt/c/path/to/VictorMono.ttf /usr/local/share/fonts/

@skvark
skvark / edison_flashing_wifi.md
Last active January 7, 2025 08:54
Flashing Intel Edison using only serial connection and wifi

Do this at your own risk. I take no responsibility for any damage caused to your board.

My Intel Edison was shipped to me with old and buggy version of the Yocto Linux image. I purchased only the console block via Sparkfun (which has only one USB port connected to UART2 (serial connection) of the Edison therefore it's not connected to the actual USB on Edison) so I could not update to a new build the normal way.

I assume you have successfully connected to the Edison via the serial connection and can use the linux console on Edison.

  1. Connect the Edison into a local WiFi network with configure_edison --wifi
  2. Check that you can access to the Edison via SSH or with browser
    • if you can't, vi /etc/systemd/system/basic.target.wants/network-gadget-init.service and change the ip addresses to i.e 192.168.99.15
  3. On Edison, cd /
@keidarcy
keidarcy / emoji.txt
Last active January 7, 2025 08:54
Plain Github emoji list
:bowtie:
😄 :smile:
😆 :laughing:
😊 :blush:
😃 :smiley:
☺️ :relaxed:
😏 :smirk:
😍 :heart_eyes:
😘 :kissing_heart:
😚 :kissing_closed_eyes:
@cavit99
cavit99 / qwen2vl.py
Last active January 7, 2025 08:52
Qwen2-VL-7B-Instruct inference on Apple silicon
import torch
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from PIL import Image
from pathlib import Path
import sys
# Toggle to switch between full response and extracted description
OUTPUT_FULL_RESPONSE = False
# Ensure we're using the MPS device if available
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active January 7, 2025 08:52
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@xiabingquan
xiabingquan / transformer_all_in_one.py
Created December 6, 2023 14:52
Implement Transformer from scratach. All modules included in one file!
# coding=utf-8
# Contact: [email protected]
import numpy as np
import torch
import torch.nn as nn
def get_len_mask(b: int, max_len: int, feat_lens: torch.Tensor, device: torch.device) -> torch.Tensor: