Skip to content

Instantly share code, notes, and snippets.

@Zirak
Zirak / editors.md
Last active February 26, 2025 17:11
Recommended editors.

Which editors do you recommend?

A heated question, oft asked in the nether of SO Chat. It's at the end, of course, a matter of taste and usage: Some editors are better than others at some things, some things are only possible in some editors.

So here's a list of editors and IDEs which we of room 17 use and can recommend, sorted alphabetically.

For beginners

Most importantly, here's a very short list of (free!) editors which are recommended for beginners to scripting or web-dev (i.e. no compiling necessary), aimed at people who just got into JavaScript, Ruby, Python, Bash, etc and want to get a feel of things. Just pick one and have fun!

Linux

@Zirak
Zirak / dragons.js
Last active October 26, 2024 20:14
typeof zInterval !== 'undefined' && clearInterval(zInterval);
var zInterval = setInterval(loop, 100);
var zState = Object.assign({
// TODO: Magical challenges
challengeCounter: 1,
// For tracking challenges and sigils
resetAt: null,
// For tracking hell
@Zirak
Zirak / calc.py
Created August 26, 2013 14:20
A Shunting Yard implementation in Python
#this program uses the Shunting Yard algorithm to transform infix expressions
# into postfix, and then an AST, which can then be easily evaluated.
#just run `python calc.py` and enjoy. enjoyment is optional and not included
# with the standard calc.py package, but for an extra $99.99 we can have a
# calc.py Premium Deluxe sent to you over the next 6-8 weeks, which may or may
# not increase your enjoyment of our calc.py product.
#for a list of operators supported and not supported (for isntance, the unary -
# is a ~) look below.
#TODO: handle parentheses.
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 4e433d9..35930db 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -641,10 +641,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
bool uses_super_property() const { return scope_uses_super_property_; }
bool NeedsHomeObject() const {
- return scope_uses_super_property_ ||
- (inner_scope_calls_eval_ && (IsConciseMethod(function_kind()) ||
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE chat(
msgid integer primary key,
time datetime,
userid integer,
username text,
avatar_url text,
// Pop quiz! What gets logged?
var o = {
[console.log('before')]: 4,
foo: (function () {
console.log('nope :(');
throw 'nope'
})(),
[console.log('after')]: 4
@Zirak
Zirak / tools.md
Created September 20, 2022 10:47
@Zirak
Zirak / gist:3086939
Last active August 27, 2022 22:01
xhr for dummies

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

require('http').createServer((req, res) => {
if (req.url === '/1.js') {
setTimeout(() => {
res.write('console.log(1);');
res.end();
}, 10000);
}
if (req.url === '/2.js') {
res.write('console.log(2);');
res.end();
@Zirak
Zirak / gist:1677020
Created January 25, 2012 16:15
Visibility API
//http://www.w3.org/TR/2011/WD-page-visibility-20110602/
(function () {
"use strict";
//no need to shim if it's already there
if ( 'hidden' in document && 'onvisibilitychange' in document ) {
return;
}
//fail silently if the browser sux