Total Pageviews

Monday, 22 June 2026

陈景润-勇攀科学高峰的数学先驱

 

陈景润(1933——1996年),福建福州人,系新中国第一代数学家,中国科学院原数学研究所研究员、学部委员,是哥德巴赫猜想研究领域的先驱者。他在逆境中坚持学术探索、在困境中追求科学真理,用一生的执着与坚守,诠释了科学精神的真谛,也彰显了中国科学家在国际舞台上的学术自信与使命担当。

闽江畔仰望星空的追梦少年。陈景润出生于福州一清寒之家,在少年时期便展现出过人的数学天分,在中学阶段曾自学了大学丛书《微积分学》、哈佛大学讲义《高等代数引论》等。1948年他考入福州英华中学念高中,有幸遇到著名的空气动力学家、航空工程教育家沈元教授。其时,沈元教授任教于清华大学,1948年返榕处理家事,因逢战事滞留福州,遂接受母校英华中学邀请,临时担任数学和物理教师。一次数学课上,他用诗意的语言讲起哥德巴赫猜想:“数学是自然科学之皇后,数论是数学之皇冠,而哥德巴赫猜想恰似皇冠上的明珠。”哥德巴赫猜想被称为近代数学三大难题之一,自1742年提出已困扰数学界近3个世纪之久。这堂课给陈景润留下了深刻的印象,哥德巴赫猜想之梦就此种进了他的心中。

1950年春夏之交,凭借顽强的自学精神和过人的天赋,陈景润以高中同等学力考入厦门大学数理系,次年适逢厦大数学系成立,遂转入数学系接受系统且严格的数学训练。大学期间,李文清教授在讲数论发展史时,介绍了哥德巴赫猜想等3个尚未解决的世界难题,再次激发起陈景润的兴趣。

1953年9月,因国家建设需要,陈景润被安排提前一年毕业分配工作。1955年2月,在时任厦大校长王亚南的帮助下,陈景润回到厦门大学资料研究室工作,后担任数学系助教,得以潜心钻研他所钟爱的数学。在厦大工作期间,正值空袭警报频发之时,陈景润将华罗庚的经典著作《堆垒素数论》拆成单页携带至防空洞中研读,展现出惊人的毅力。其间,他发现书中关于“塔内问题”的论证尚有不足,将自己的改进方法撰写成《塔内问题》一文,受到华罗庚赏识。1956年8月,受华罗庚推荐赴京参加全国数学论文报告会,其研究成果获学界认可。1957年,在华罗庚的推荐下,陈景润正式调入中国科学院数学研究所。

撼动世界的“陈氏定理”。调入中国科学院后,陈景润获得了更广阔的科研平台,他将全部精力投入到哥德巴赫猜想这一世界数学难题的研究中。1966年5月,于《科学通报》上宣布证明了哥德巴赫猜想研究中的关键命题“1+2”,即“每一个大偶数都可以表示为一个素数及一个不超过两个素数的乘积之和”。然而,由于整个论文长达200多页,《科学通报》上的论证仅叙述了几个引理,论证过程并未得到翔实展示,国际数学界对此存有疑虑。

面对质疑,陈景润展现出非凡的定力和科学严谨精神。随后的7年里,在既无桌椅亦无书案,只有一块兼具卧床与书桌功能的木板,面积仅6平方米的狭小宿舍空间内,陈景润忍受病痛侵扰,以常人难以想象的毅力,夜以继日地对该证明进行反复推敲、完善和简化。1973年,他在《中国科学》杂志上发表了《大偶数表为一个素数及一个不超过二个素数的乘积之和》,详细证明了“1+2”,论文长度从原来的200多页精简到了100页,亦改进了1966年的结果。此项近乎以生命铸就的成果,以其无懈可击的逻辑和深刻的洞见,彻底征服了国际数学界,被誉为“移动群山”的杰作。当时英国数学家哈勃斯丹和李希特合著的《筛法》正在校印阶段,他们见到陈景润的论文后,立刻在书中补加一章“陈氏定理”(Chen's Theo-rem),才将书付印。“陈氏定理”的诞生,不仅是中国数学界具有里程碑意义的重大突破,更极大提升了中国基础科学研究的国际地位。它将哥德巴赫猜想的研究推进到前所未有的新高度,使最小素数从80推进至16,并将古老的筛法理论优化至被同行称颂的“光辉顶点”。这个定理被载入美、英、法、苏、日等国的许多论文专著,足见其影响之广泛。世界级的数学大师、美国学者阿·威尔说:“陈景润的每一项工作,都好像是在喜马拉雅山山巅上行走,每前进一步都非常困难。”高度赞誉陈景润攀登科学险峰的孤勇精神与辉煌成就。1977年初,完成论文《算术级数中的最小素数》,其研究成果至今在哥德巴赫猜想的研究领域还保持着领先地位。除了广为人知的哥德巴赫猜想外,陈景润在圆内格点问题、球内格点问题、华林问题等解析数论方面均有重要成果。

1978年1月,《人民文学》杂志刊载了徐迟的长篇报告文学《哥德巴赫猜想》;之后,《人民日报》《光明日报》大篇幅转载了这篇文章。陈景润的事迹传遍大江南北,极大地振奋了民族精神,点燃了无数青年投身科学事业的热情,成为解放思想、尊重知识、尊重人才时代潮流中一面耀眼的旗帜。陈景润也成为“科学的春天”最具代表性的象征人物。

名利之外的家国情怀。在生命的最后十年,即使身体状况不佳、科研工作繁忙,陈景润依然心系科普和人才培养,一次次应邀为中小学生开设讲座,以自身经历勉励青年学子:“科学探索需要决心、信心、恒心。”陈景润以超乎常人的意志,在病榻上完成了《哥德巴赫猜想》《趣味数学趣谈》《组合数学简介》《初等数论》等4部面向青少年的数学科普著作。这些著作语言通俗易懂,阐释深入浅出,成为启迪青少年数学思维、引领他们步入科学殿堂的经典读物。在证明了“1+2”后直到生命的终结,陈景润用一种与生命赛跑的态度向“1+1”这一顶峰发起进攻。住院治疗期间,他输液拒扎右手以坚持书写,直至喉咙失语、手不能握笔,还用含混语言和手势同学生探讨问题,依然表示“我不能停止工作”。

陈景润的一生,是纯粹科学家的一生,更是爱国知识分子的一生。1979年,陈景润应邀前往美国普林斯顿高等研究院讲学与访问期间,整天泡在图书馆、办公室里潜心治学,生活极其简朴。归国时,陈景润将节衣缩食积攒的7500美元全部上交国家。面对赞誉,他只有一句朴素的话语:“我们的国家还不富裕。”这份深沉的爱国热忱,超越了一切世俗的荣华。1996年3月,他安静地离开了这个世界,留下遗愿要将遗体捐献以作“科学事业最后的奉献”,其拳拳之心,尽显对祖国科学事业的殷切期望和无私奉献。

1999年,浩瀚星海增添了一个属于中国科学家的名字——经国际小天体命名委员会批准,将国际永久编号“7681”的小行星命名为“陈景润星”。这是首颗获得命名权的素数编号小行星,既是对陈景润永恒的纪念,也是宇宙星空中独一无二的科学丰碑。

from  https://www.cas.cn/xzfc/202507/t20250725_5077687.shtml

------------------------------------------------------------------------------------------------

陈景润的老婆由昆对他照顾有加。

https://baike.baidu.com/item/%E9%99%88%E6%99%AF%E6%B6%A6/18067

https://baike.baidu.com/item/%E7%94%B1%E6%98%86/5439453

  

Sunday, 21 June 2026

Claw-Code

 An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention. 


LazyCodex banner Gajae-Code banner

LazyCodex GitHub card Gajae-Code GitHub card

start with the real crab-powered harnesses

github.com/code-yeongyu/lazycodex
github.com/Yeachan-Heo/gajae-code

Open LazyCodex on GitHub Open Gajae-Code on GitHub

Join the harness lab on Discord Join the crab tank on Discord

Join the Discords: ultraworkers discord · gajae-code discord

Important

Claw Code is not the serious production project here. This repository is closer to a museum exhibit than a product pitch, a crustacean-run artifact kept alive by clawed gajaes, swept and labeled by agents, and automatically maintained according to the harnesses above.

As already described in the project philosophy, this is not meant to be hand-operated like a normal product repo. It is an agent-managed exhibit: the harnesses plan, execute, verify, label, and preserve the artifact while the crabs keep the tank running.

If you want to actually run work, start with LazyCodex or Gajae-Code. If you want to inspect the strange little fossil of the Claw Code moment, continue below.

For the longer public explanation behind this philosophy, see here.

ultraworkers/claw-code · Usage · Rust workspace · Parity · Roadmap · Contributing · Security · UltraWorkers Discord

Claw Code is the public Rust implementation of the claw CLI agent harness. The canonical implementation lives in rust/, and the current source of truth for this repository is ultraworkers/claw-code.

Important

Start with USAGE.md for build, auth, CLI, session, and parity-harness workflows. For file submission/navigation questions, see Navigation and file context. For local OpenAI-compatible models and offline skill installs, see Local OpenAI-compatible providers and skills setup. Windows users can jump to the PowerShell-first Windows install and release quickstart. Make claw doctor your first health check after building, use rust/README.md for crate-level details, read PARITY.md for the current Rust-port checkpoint, and see docs/container.md for the container-first workflow.

ACP / Zed status: claw-code does not ship an ACP/Zed daemon or JSON-RPC entrypoint yet. Run claw acp (or claw --acp) for the current status instead of guessing from source layout; claw acp serve is currently a discoverability alias only, returns status with exit code 0, and real ACP support remains tracked separately in ROADMAP.md. For the public JSON contract, see docs/g011-acp-json-rpc-status-contract.md.

Current repository shape

  • rust/ — canonical Rust workspace and the claw CLI binary
  • USAGE.md — task-oriented usage guide for the current product surface
  • PARITY.md — Rust-port parity status and migration notes
  • ROADMAP.md — active roadmap and cleanup backlog
  • PHILOSOPHY.md — project intent and system-design framing
  • src/ + tests/ — companion Python/reference workspace and audit helpers; not the primary runtime surface

Quick start

Note

[!WARNING] cargo install claw-code installs the wrong thing. The claw-code crate on crates.io is a deprecated stub that places claw-code-deprecated.exe — not claw. Running it only prints "claw-code has been renamed to agent-code". Do not use cargo install claw-code. Either build from source (this repo) or install the upstream binary:

cargo install agent-code   # upstream binary — installs 'agent.exe' (Windows) / 'agent' (Unix), NOT 'agent-code'

This repo (ultraworkers/claw-code) is build-from-source only — follow the steps below.

# 1. Clone and build
git clone https://github.com/ultraworkers/claw-code
cd claw-code/rust
cargo build --workspace

# 2. Set your API key (Anthropic API key — not a Claude subscription)
export ANTHROPIC_API_KEY="sk-ant-..."

# 3. Verify everything is wired correctly
./target/debug/claw doctor

# 4. Run a prompt
./target/debug/claw prompt "say hello"

# 5. Start an interactive session
./target/debug/claw

Note

Windows (PowerShell): the binary is claw.exe, not claw. Use .\target\debug\claw.exe or run cargo run -- prompt "say hello" to skip the path lookup.

Windows setup

PowerShell is a supported Windows path. Use whichever shell works for you. The common onboarding issues on Windows are:

  1. Install Rust first — download from https://rustup.rs/ and run the installer. Close and reopen your terminal when it finishes.
  2. Verify Rust is on PATH:
    cargo --version
    If this fails, reopen your terminal or run the PATH setup from the Rust installer output, then retry.
  3. Clone and build (works in PowerShell, Git Bash, or WSL):
    git clone https://github.com/ultraworkers/claw-code
    cd claw-code/rust
    cargo build --workspace
  4. Run (PowerShell — note .exe and backslash):
    $env:ANTHROPIC_API_KEY = "sk-ant-..."
    .\target\debug\claw.exe prompt "say hello"

For release ZIPs, PATH setup, provider switching, and notification smoke checks, see docs/windows-install-release.md.

Git Bash / WSL are optional alternatives, not requirements. If you prefer bash-style paths (/c/Users/you/... instead of C:\Users\you\...), Git Bash (ships with Git for Windows) works well. In Git Bash, the MINGW64 prompt is expected and normal — not a broken install.

Post-build: locate the binary and verify

After running cargo build --workspace, the claw binary is built but not automatically installed to your system. Here's where to find it and how to verify the build succeeded.

Binary location

After cargo build --workspace in claw-code/rust/:

Debug build (default, faster compile):

  • macOS/Linux: rust/target/debug/claw
  • Windows: rust/target/debug/claw.exe

Release build (optimized, slower compile):

  • macOS/Linux: rust/target/release/claw
  • Windows: rust/target/release/claw.exe

If you ran cargo build without --release, the binary is in the debug/ folder.

Verify the build succeeded

Test the binary directly using its path:

# macOS/Linux (debug build)
./rust/target/debug/claw --help
./rust/target/debug/claw doctor

# Windows PowerShell (debug build)
.\rust\target\debug\claw.exe --help
.\rust\target\debug\claw.exe doctor

PowerShell smoke commands that do not require live credentials:

$env:CLAW_CONFIG_HOME = Join-Path $env:TEMP "claw config home"
New-Item -ItemType Directory -Force -Path $env:CLAW_CONFIG_HOME | Out-Null
Remove-Item Env:\ANTHROPIC_API_KEY, Env:\ANTHROPIC_AUTH_TOKEN, Env:\OPENAI_API_KEY -ErrorAction SilentlyContinue
.\rust\target\debug\claw.exe help
.\rust\target\debug\claw.exe status
.\rust\target\debug\claw.exe config env
.\rust\target\debug\claw.exe doctor

If these commands succeed, the build is working. claw doctor is your first health check — it validates your API key, model access, and tool configuration.

Optional: Add to PATH

If you want to run claw from any directory without the full path, choose one of these approaches:

Option 1: Symlink (macOS/Linux)

ln -s $(pwd)/rust/target/debug/claw /usr/local/bin/claw

Then reload your shell and test:

claw --help

Option 2: Use cargo install (all platforms)

Build and install to Cargo's default location (~/.cargo/bin/, which is usually on PATH):

# From the claw-code/rust/ directory
cargo install --path . --force

# Then from anywhere
claw --help

Option 3: Update shell profile (bash/zsh)

Add this line to ~/.bashrc or ~/.zshrc:

export PATH="$(pwd)/rust/target/debug:$PATH"

Reload your shell:

source ~/.bashrc  # or source ~/.zshrc
claw --help

Troubleshooting

  • "command not found: claw" — The binary is in rust/target/debug/claw, but it's not on your PATH. Use the full path ./rust/target/debug/claw or symlink/install as above.
  • "permission denied" — On macOS/Linux, you may need chmod +x rust/target/debug/claw if the executable bit isn't set (rare).
  • Debug vs. release — If the build is slow, you're in debug mode (default). Add --release to cargo build for faster runtime, but the build itself will take 5–10 minutes.

Note

Auth: claw requires an API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) — Claude subscription login is not a supported auth path.

Run the workspace test suite after verifying the binary works:

cd rust
cargo test --workspace

Documentation map

Ecosystem

Claw Code is built in the open alongside the broader UltraWorkers toolchain:

Ownership / affiliation disclaimer

  • This repository does not claim ownership of the original Claude Code source material.
  • This repository is not affiliated with, endorsed by, or maintained by Anthropic.

from  https://github.com/ultraworkers/claw-code

Hubot

 

A customizable life embetterment robot.

 

Build Status: MacOS Build Status: Ubuntu Build Status: Window

Note: v10.0.4 accidentally contains the removal of CoffeeScript; v10.0.5 puts it back in Note: v11 removes CoffeeScript and converts this codebase to ESM

Hubot is a framework to build chat bots, modeled after GitHub's Campfire bot of the same name, hubot. He's pretty cool. He's extendable with scripts and can work on many different chat services.

This repository provides a library that's distributed by npm that you use for building your own bots. See the documentation for details on getting up and running with your very own robot friend.

In most cases, you'll probably never have to hack on this repo directly if you are building your own bot. But if you do, check out CONTRIBUTING.md

Create your own Hubot instance

This will create a directory called myhubot in the current working directory.

npx hubot --create myhubot --adapter @hubot-friends/hubot-slack
npx hubot --create myhubot --adapter @hubot-friends/hubot-discord
npx hubot --create myhubot --adapter @hubot-friends/hubot-ms-teams
npx hubot --create myhubot --adapter @hubot-friends/hubot-irc

Review scripts/example.mjs. Create more scripts in the scripts folder.

Command bus (robot.commands)

Hubot includes a deterministic command subsystem for slash-style commands. It is safe by default and does not interfere with legacy hear and respond listeners.

Basic Command Registration

export default (robot) => {
	robot.commands.register({
		id: 'tickets.create',
		description: 'Create a ticket',
		aliases: ['ticket new', 'new ticket'],
		args: {
			title: { type: 'string', required: true },
			priority: { type: 'enum', values: ['low', 'medium', 'high'], default: 'medium' }
		},
		sideEffects: ['creates external ticket'],
		handler: async (ctx) => {
			return `Created ticket: ${ctx.args.title}`
		}
	})
}

Invoke with addressing the bot:

  • @hubot tickets.create --title "VPN down" --priority high
  • @hubot tickets.create title:"VPN down" priority:high

Commands that declare side effects will require confirmation before execution.

The user is asked to confirm. They do so like so:

@hubot yes
@hubot no
@hubot cancel

Aliases are for discovery and search only. They do not execute commands or create proposals. They are intent utterances.

Built-in Help Command

Hubot automatically registers a help command that provides command discovery and documentation:

@hubot help                          # List all commands
@hubot help tickets                  # Filter commands by prefix
@hubot help search "create ticket"   # Search by keyword, alias, description, or example
 from https://github.com/hubotio/hubot

action-send-email

 

Github Action for Sending Email

This is a action for sending email.

Usage

name: 'Send Email'

on:
  push:
    branches:
    - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: 'Send Email'
      uses: hujiulong/action-send-email@master
      with:
        # The hostname or IP address to, required
        host: 'smtp.server.com'

        # The port to connect to
        # Default: 587 if is secure is false or 465 if true
        port: 587

        # If true the connection will use TLS when connecting to server
        secure: false

        # Username, required
        username: ${{ secrets.EMAIL_USERNAME }}

        # Password, required
        password: ${{ secrets.EMAIL_PASSWORD }}

        # The subject of the email, required
        subject: 'subject'

        # The plaintext version of the message
        text: 'text content'

        # The html version of the message
        html: '<p>html content</p>'

        # The email address of the sender
        # Default: username
        from: 'Sender <sender@server.com>'

        # The email address of the receiver
        to: 'receiver@server.com'
from  https://github.com/hujiulong/action-send-email

slate, A completely customizable framework for building rich text editors(基于nodejs)

 

 (Currently in beta.)

slatejs.org

A completely customizable framework
for building rich text editors.

Why? · Principles · Demo · Examples · Documentation 

Slate lets you build rich, intuitive editors like those in Medium, Dropbox Paper or Google Docs—which are becoming table stakes for applications on the web—without your codebase getting mired in complexity.

It can do this because all of its logic is implemented with a series of plugins, so you aren't ever constrained by what is or isn't in "core". You can think of it like a pluggable implementation of contenteditable built on top of React. It was inspired by libraries like Draft.js, Prosemirror and Quill.

🤖 Slate is currently in beta. Its core API is useable right now, but you might need to pull request improvements for advanced use cases, or fixes for some bugs. Some of its APIs are not "finalized" and will have breaking changes over time as we discover better solutions. There isn't currently a 1.0 release schedule, we're still getting the architecture right.

🤖 Slate is also contributor-driven. It is not backed by any huge company, which means that all contributions are voluntary and done by the people who need them. If you need something improved, added, or fixed, please contribute it yourself or no one will. And if you want to become a more active maintainer, let us know in the Slack channel.


Why?

Why create Slate? Well... (Beware: this section has a few of my opinions!)

Before creating Slate, I tried a lot of the other rich text libraries out there—Draft.js, Prosemirror, Quill, etc. What I found was that while getting simple examples to work was easy enough, once you started trying to build something like Medium, Dropbox Paper or Google Docs, you ran into deeper issues...

  • The editor's "schema" was hardcoded and hard to customize. Things like bold and italic were supported out of the box, but what about comments, or embeds, or even more domain-specific needs?

  • Transforming the documents programmatically was very convoluted. Writing as a user may have worked, but making programmatic changes, which is critical for building advanced behaviors, was needlessly complex.

  • Serializing to HTML, Markdown, etc. seemed like an afterthought. Simple things like transforming a document to HTML or Markdown involved writing lots of boilerplate code, for what seemed like very common use cases.

  • Re-inventing the view layer seemed inefficient and limiting. Most editors rolled their own views, instead of using existing technologies like React, so you have to learn a whole new system with new "gotchas".

  • Collaborative editing wasn't designed for in advance. Often the editor's internal representation of data made it impossible to use to for a realtime, collaborative editing use case without basically rewriting the editor.

  • The repositories were monolithic, not small and reusable. The code bases for many of the editors often didn't expose the internal tooling that could have been re-used by developers, leading to having to reinvent the wheel.

  • Building complex, nested documents was impossible. Many editors were designed around simplistic "flat" documents, making things like tables, embeds and captions difficult to reason about and sometimes impossible.

Of course not every editor exhibits all of these issues, but if you've tried using another editor you might have run into similar problems. To get around the limitations of their API's and achieve the user experience you're after, you have to resort to very hacky things. And some experiences are just plain impossible to achieve.

If that sounds familiar, you might like Slate.

Which brings me to how Slate solves all of that...


Principles

Slate tries to solve the question of "Why?" with a few principles:

  1. First-class plugins. The most important part of Slate is that plugins are first-class entities. That means you can completely customize the editing experience, to build complex editors like Medium's or Dropbox's, without having to fight against the library's assumptions.

  2. Schema-less core. Slate's core logic assumes very little about the schema of the data you'll be editing, which means that there are no assumptions baked into the library that'll trip you up when you need to go beyond the most basic use cases.

  3. Nested document model. The document model used for Slate is a nested, recursive tree, just like the DOM itself. This means that creating complex components like tables or nested block quotes are possible for advanced use cases. But it's also easy to keep it simple by only using a single level of hierarchy.

  4. Parallel to the DOM. Slate's data model is based on the DOM—the document is a nested tree, it uses selections and ranges, and it exposes all the standard event handlers. This means that advanced behaviors like tables or nested block quotes are possible. Pretty much anything you can do in the DOM, you can do in Slate.

  5. Intuitive commands. Slate documents are edited using "commands", that are designed to be high-level and extremely intuitive to write and read, so that custom functionality is as expressive as possible. This greatly increases your ability to reason about your code.

  6. Collaboration-ready data model. The data model Slate uses—specifically how operations are applied to the document—has been designed to allow for collaborative editing to be layered on top, so you won't need to rethink everything if you decide to make your editor collaborative.

  7. Clear "core" boundaries. With a plugin-first architecture, and a schema-less core, it becomes a lot clearer where the boundary is between "core" and "custom", which means that the core experience doesn't get bogged down in edge cases.

Demo

Check out the live demo of all of the examples!

Examples

To get a sense for how you might use Slate, check out a few of the examples:

  • Plain text — showing the most basic case: a glorified <textarea>.
  • Rich text — showing the features you'd expect from a basic editor.
  • Markdown preview — showing how to add key handlers for Markdown-like shortcuts.
  • Inlines — showing how wrap text in inline nodes with associated data.
  • Images — showing how to use void (text-less) nodes to add images.
  • Hovering toolbar — showing how a hovering toolbar can be implemented.
  • Tables — showing how to nest blocks to render more advanced components.
  • Paste HTML — showing how to use an HTML serializer to handle pasted HTML.
  • Mentions — showing how to use inline void nodes for simple @-mentions.
  • See all the examples...

If you have an idea for an example that shows a common use case, pull request it!


Documentation

If you're using Slate for the first time, check out the Getting Started walkthroughs and the Concepts to familiarize yourself with Slate's architecture and mental models.

If even that's not enough, you can always read the source itself, which is heavily commented.

There are also translations of the documentation into other languages:

If you're maintaining a translation, feel free to pull request it here!

Packages

Slate's codebase is monorepo managed with Lerna. It consists of a handful of packages—although you won't always use all of them. They are:

Package Version Size Description
slate Slate's core data model logic.
slate-history A plugin that adds undo/redo history to Slate.
slate-hyperscript A hyperscript tool to write JSX Slate documents!
slate-react

React components for rendering Slate editors. 

from https://github.com/ianstormtaylor/slate

示例: https://www.slatejs.org/examples/embeds,输入某个youtube video的网址,就可渲染出视频,比如https://www.youtube.com/embed/asKQbk7AcJU

(注意:此slate是基于nodejs的程序,不是另一个slate:  https://briteming.blogspot.com/2016/06/slatemiddleman.html ,那个slate是基于ruby的静态网站程序)

情网

 

Pluto-CMS

 a WYDIWYS CMS powered by Rails framework

This is a open-source Rails Content Management System.

==	About How Sticker Works

1. Set up your templet files, it should contains <%= sticker_tag %> 


In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in
link:files/vendor/rails/activerecord/README.html.

The controller and view are handled by the Action Pack, which handles both
layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
Rails.  You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.


== Getting Started

1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
   and your application name. Ex: rails myapp
2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
4. Follow the guidelines to start developing your application


== Web Servers

By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
with a variety of other web servers.

Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
More info at: http://mongrel.rubyforge.org

Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.

== Apache .htaccess example for FCGI/CGI

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
# 
# Example:
#   RewriteCond %{REQUEST_URI} ^/notrails.*
#   RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
# 
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
#   Alias /myrailsapp /path/to/myrailsapp/public
#   RewriteBase /myrailsapp

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
# 
# Example:
#   ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"


== Debugging Rails

Sometimes your application goes wrong.  Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.

First area to check is the application log files.  Have "tail -f" commands running
on the server.log and development.log. Rails will automatically display debugging
and runtime information to these files. Debugging info will also be shown in the
browser on requests from 127.0.0.1.

You can also log your own messages directly into the log file from your code using
the Ruby logger class from inside your controllers. Example:

  class WeblogController < ActionController::Base
    def destroy
      @weblog = Weblog.find(params[:id])
      @weblog.destroy
      logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
    end
  end

The result will be a message in your log file along the lines of:

  Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1

More information on how to use the logger is at http://www.ruby-doc.org/core/

Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:

* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
* Learn to Program: http://pine.fm/LearnToProgram/  (a beginners guide)

These two online (and free) books will bring you up to speed on the Ruby language
and also on programming in general.


== Debugger

Debugger support is available through the debugger command when you start your Mongrel or
Webrick server with --debugger. This means that you can break out of execution at any point
in the code, investigate and change the model, AND then resume execution! 
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
Example:

  class WeblogController < ActionController::Base
    def index
      @posts = Post.find(:all)
      debugger
    end
  end

So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:

  >> @posts.inspect
  => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
       #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
  >> @posts.first.title = "hello from a debugger"
  => "hello from a debugger"

...and even better is that you can examine how your runtime objects actually work:

  >> f = @posts.first
  => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
  >> f.
  Display all 152 possibilities? (y or n)

Finally, when you're ready to resume execution, you enter "cont"


== Console

You can interact with the domain model by starting the console through <tt>script/console</tt>.
Here you'll have all parts of the application configured, just like it is when the
application is running. You can inspect domain models, change values, and save to the
database. Starting the script without arguments will launch it in the development environment.
Passing an argument will specify a different environment, like <tt>script/console production</tt>.

To reload your controllers and models after launching the console run <tt>reload!</tt>

== dbconsole

You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
You would be connected to the database with the credentials defined in database.yml.
Starting the script without arguments will connect you to the development database. Passing an
argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
Currently works for mysql, postgresql and sqlite.

== Description of Contents

app
  Holds all the code that's specific to this particular application.

app/controllers
  Holds controllers that should be named like weblogs_controller.rb for
  automated URL mapping. All controllers should descend from ApplicationController
  which itself descends from ActionController::Base.

app/models
  Holds models that should be named like post.rb.
  Most models will descend from ActiveRecord::Base.

app/views
  Holds the template files for the view that should be named like
  weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
  syntax.

app/views/layouts
  Holds the template files for layouts to be used with views. This models the common
  header/footer method of wrapping views. In your views, define a layout using the
  <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
  call <% yield %> to render the view using this layout.

app/helpers
  Holds view helpers that should be named like weblogs_helper.rb. These are generated
  for you automatically when using script/generate for controllers. Helpers can be used to
  wrap functionality for your views into methods.

config
  Configuration files for the Rails environment, the routing map, the database, and other dependencies.

db
  Contains the database schema in schema.rb.  db/migrate contains all
  the sequence of Migrations for your schema.

doc
  This directory is where your application documentation will be stored when generated
  using <tt>rake doc:app</tt>

lib
  Application specific libraries. Basically, any kind of custom code that doesn't
  belong under controllers, models, or helpers. This directory is in the load path.

public
  The directory available for the web server. Contains subdirectories for images, stylesheets,
  and javascripts. Also contains the dispatchers and the default HTML files. This should be
  set as the DOCUMENT_ROOT of your web server.

script
  Helper scripts for automation and generation.

test
  Unit and functional tests along with fixtures. When using the script/generate scripts, template
  test files will be generated for you and placed in this directory.

vendor
  External libraries that the application depends on. Also includes the plugins subdirectory.
  If the app has frozen rails, those gems also go here, under vendor/rails/.
  This directory is in the load path.
from  https://github.com/xhan/Pluto-CMS