Glitch：可以让你立即写出有趣的小型网站
Glitch JavaScript
![](/data/attachment/album/201712/12/165925g24w582uc5g553e7.jpg)


我刚写了一篇关于 Jupyter Notebooks 的文章，它是一个有趣的交互式写 Python 代码的方式。这让我想起我最近学习了 Glitch，这个我同样喜爱！我构建了一个小的程序来用于[关闭转发 twitter](https://turn-off-retweets.glitch.me/)。因此有了这篇文章！


[Glitch](https://glitch.com/) 是一个简单的构建 Javascript web 程序的方式（javascript 后端、javascript 前端）。


关于 glitch 有趣的地方有：


1. 你在他们的网站输入 Javascript 代码
2. 只要输入了任何代码，它会自动用你的新代码重载你的网站。你甚至不必保存！它会自动保存。


所以这就像 Heroku，但更神奇！像这样的编码（你输入代码，代码立即在公共网络上运行）对我而言感觉很**有趣**。


这有点像用 ssh 登录服务器，编辑服务器上的 PHP/HTML 代码，它立即就可用了，而这也是我所喜爱的方式。虽然现在我们有了“更好的部署实践”，而不是“编辑代码，让它立即出现在互联网上”，但我们并不是在谈论严肃的开发实践，而是在讨论编写微型程序的乐趣。


### Glitch 有很棒的示例应用程序


Glitch 似乎是学习编程的好方式！


比如，这有一个太空侵略者游戏（由 [Mary Rose Cook](https://maryrosecook.com/) 编写）：<https://space-invaders.glitch.me/>。我喜欢的是我只需要点击几下。


1. 点击 “remix this”
2. 开始编辑代码使箱子变成橘色而不是黑色
3. 制作我自己太空侵略者游戏！我的在这：<http://julias-space-invaders.glitch.me/>。（我只做了很小的更改使其变成橘色，没什么神奇的）


他们有大量的示例程序，你可以从中启动 - 例如[机器人](https://glitch.com/handy-bots)、[游戏](https://glitch.com/games)等等。


### 实际有用的非常好的程序：tweetstorms


我学习 Glitch 的方式是从这个程序开始的：<https://tweetstorms.glitch.me/>，它会向你展示给定用户的推特云。


比如，你可以在 <https://tweetstorms.glitch.me/sarahmei> 看到 [@sarahmei](https://twitter.com/sarahmei) 的推特云（她发布了很多好的 tweetstorm！）。


### 我的 Glitch 程序： 关闭转推


当我了解到 Glitch 的时候，我想关闭在 Twitter 上关注的所有人的转推（我知道可以在 Tweetdeck 中做这件事），而且手动做这件事是一件很痛苦的事 - 我一次只能设置一个人。所以我写了一个 Glitch 程序来为我做！


我喜欢我不必设置一个本地开发环境，我可以直接开始输入然后开始！


Glitch 只支持 Javascript，我不是非常了解 Javascript（我之前从没写过一个 Node 程序），所以代码不是很好。但是编写它很愉快 - 能够输入并立即看到我的代码运行是令人愉快的。这是我的项目：<https://turn-off-retweets.glitch.me/>。


### 就是这些！


使用 Glitch 感觉真的很有趣和民主。通常情况下，如果我想 fork 某人的 Web 项目，并做出更改，我不会这样做 - 我必须 fork，找一个托管，设置本地开发环境或者 Heroku 或其他，安装依赖项等。我认为像安装 node.js 依赖关系这样的任务在过去很有趣，就像“我正在学习新东西很酷”，但现在我觉得它们很乏味。


所以我喜欢只需点击 “remix this!” 并立即在互联网上能有我的版本。




---


via: <https://jvns.ca/blog/2017/11/13/glitch--write-small-web-projects-easily/>


作者：[Julia Evans](https://jvns.ca/) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
I just wrote about Jupyter Notebooks which are a fun interactive way to write Python code. That
reminded me I learned about Glitch recently, which I also love!! I built a small app to [turn of twitter retweets](https://turn-off-retweets.glitch.me/) with it. So!

[Glitch](https://glitch.com/) is an easy way to make Javascript webapps. (javascript backend,
javascript frontend)

The fun thing about glitch is:

- you start typing Javascript code into their web interface
- as soon as you type something, it automagically reloads the backend of your website with the new code. You don’t even have to save!! It autosaves.

So it’s like Heroku, but even more magical!! Coding like this (you type, and the code runs on
the public internet immediately) just feels really **fun** to me.

It’s kind of like sshing into a server and editing PHP/HTML code on your server and having it instantly available, which I kind of also loved. Now we have “better deployment practices” than “just edit the code and it is instantly on the internet” but we are not talking about Serious Development Practices, we are talking about writing tiny programs for fun.

### glitch has awesome example apps

Glitch seems like fun nice way to learn programming!

For example, there’s a space invaders game (code by [Mary Rose Cook](https://maryrosecook.com/)) at [https://space-invaders.glitch.me/](https://space-invaders.glitch.me/). The thing I love about this is that in just a few clicks I can

- click “remix this”
- start editing the code to make the boxes orange instead of black
- have my own space invaders game!! Mine is at
[http://julias-space-invaders.glitch.me/](http://julias-space-invaders.glitch.me/). (i just made very tiny edits to make it orange, nothing fancy)

They have tons of example apps that you can start from – for instance
[bots](https://glitch.com/handy-bots), [games](https://glitch.com/games), and more.

### awesome actually useful app: tweetstorms

The way I learned about Glitch was from this app which shows you tweetstorms from a given user: [https://tweetstorms.glitch.me/](https://tweetstorms.glitch.me/).

For example, you can see [@sarahmei](https://twitter.com/sarahmei)’s tweetstorms at [https://tweetstorms.glitch.me/sarahmei](https://tweetstorms.glitch.me/sarahmei) (she
tweets a lot of good tweetstorms!).

### my glitch app: turn off retweets

When I learned about Glitch I wanted to turn off retweets for everyone I follow on Twitter (I know you can do it in Tweetdeck!) and doing it manually was a pain – I had to do it one person at a time. So I wrote a tiny Glitch app to do it for me!

I liked that I didn’t have to set up a local development environment, I could just start typing and go!

Glitch only supports Javascript and I don’t really know Javascript that well (I think I’ve never
written a Node program before), so the code isn’t awesome. But I had a really good time writing it
– being able to type and just see my code running instantly was delightful. Here it is:
[https://turn-off-retweets.glitch.me/](https://turn-off-retweets.glitch.me/).

### that’s all!

Using Glitch feels really fun and democratic. Usually if I want to fork someone’s web project and make changes I wouldn’t do it – I’d have to fork it, figure out hosting, set up a local dev environment or Heroku or whatever, install the dependencies, etc. I think tasks like installing node.js dependencies used to be interesting, like “cool i am learning something new” and now I just find them tedious.

So I love being able to just click “remix this!” and have my version on the internet instantly.