Skip to content

Instantly share code, notes, and snippets.

@hellokaton
hellokaton / card.html
Last active March 5, 2025 07:38
卡片生成提示词+网页
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>笔记卡片生成器</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- HTML2Canvas 导出功能 -->
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
@anamewing
anamewing / cleveref-chinese.tex
Last active March 5, 2025 07:37
Add Simplified Chinese translation to cleveref.
\crefname{equation}{式}{式}
\crefname{figure}{图}{图}
\crefname{table}{表}{表}
\crefname{page}{页}{页}
\crefname{chapter}{章}{章}
\crefname{section}{节}{节}
\crefname{appendix}{附录}{附录}
\crefname{theorem}{定理}{定理}
\crefname{lemma}{引理}{引理}
\crefname{corollary}{推论}{推论}
@rafaelhrborges
rafaelhrborges / JasperToJrxmlConverter
Created May 7, 2015 17:31
Decompile a jasper report file to its source jxrml
package mega;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.xml.JRXmlWriter;
public class JasperToJrxmlConverter {
public static String sourcePath,outputPath;
@eavae
eavae / ast_markdown_splitter.py
Last active March 5, 2025 07:37
A Simple AST based Markdown Splitter
import mistletoe
import re
import mistletoe.markdown_renderer
import warnings
from typing import Any, Callable, List, Sequence, TYPE_CHECKING
from mistletoe.span_token import (
SpanToken,
RawText,
)
@zacwest
zacwest / ios-font-sizes.swift
Last active March 5, 2025 07:33
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@Kartones
Kartones / postgres-cheatsheet.md
Last active March 5, 2025 07:32
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<?php
/**
* Get the file size of any remote resource (using get_headers()),
* either in bytes or - default - as human-readable formatted string.
*
* @author Stephan Schmitz <[email protected]>
* @license MIT <http://eyecatchup.mit-license.org/>
* @url <https://gist.github.com/eyecatchup/f26300ffd7e50a92bc4d>
*
* @param string $url Takes the remote object's URL.
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 5, 2025 07:30 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@matthewtoast
matthewtoast / create-blitz-frontend-only-app.js
Created February 26, 2022 14:59
Script to create a frontend-only Blitz app
const cp = require("child_process")
const fs = require('fs')
const path = require('path')
const { argv } = process
const appName = argv[argv.length - 1]
if (!appName || appName.includes('.')) {
throw new Error('Please provide a valid app name')
}
// cp.execSync("yarn global add serve", { stdio: "inherit" })
// cp.execSync("yarn global add blitz", { stdio: "inherit" })
@rssnyder
rssnyder / oracle-cloud-free-tier-guide.md
Last active March 5, 2025 07:23
oracle-cloud-free-tier-guide

how to leverage oracle's temping offers

free tier limits

The limits of the free tier say that you can create up to 4 instances.

  • x2 x86 instances (2core/1g)
  • x2 ampere instances (with 4core/24g spread between them)
  • 200GB total boot volume space across all intances (minimum of 50G per instance)

create your account