Skip to content

Instantly share code, notes, and snippets.

View anandgeorge's full-sized avatar

Anand George anandgeorge

  • Storm Consulting
  • Mumbai, India
View GitHub Profile
@dz4k
dz4k / discord_bot._hs
Last active June 24, 2024 07:08
Discord bot in _hyperscript
require discord.js as Discord
init immediately
make a Discord.Client from {
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES]
}
set module discord to it
login(process.env.TOKEN) to discord
end
@creationix
creationix / jsonparse.js
Last active May 10, 2024 14:36
A streaming JSON parser as an embeddable state machine.
// A streaming byte oriented JSON parser. Feed it a single byte at a time and
// it will emit complete objects as it comes across them. Whitespace within and
// between objects is ignored. This means it can parse newline delimited JSON.
function jsonMachine(emit, next) {
next = next || $value;
return $value;
function $value(byte) {
if (!byte) return;
if (byte === 0x09 || byte === 0x0a || byte === 0x0d || byte === 0x20) {
@nijikokun
nijikokun / Retinafy.md
Created July 24, 2012 01:42
Retinafy your site, a free book

Retinafy Your Site / Device

By Nijiko Yonskai

=====

I made a book, its one page.

Table Of Contents