Skip to content

Instantly share code, notes, and snippets.

$ ninja -C out/Default/ unit_tests │·················
ninja: Entering directory `out/Default/' │·················
[1/1] LINK ./unit_tests │·················
FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -B../../third_party/binutils/Linux_x64/Release/bin -fuse-ld=gold │·················
-Wl,--icf=all -pthread -m64 --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -Wl,-rpath-link=..
import * as foo from './foo';
foo
.bar();
@Zirak
Zirak / main.go
Created September 15, 2015 11:06
package main
import (
"log"
"math/rand"
"os"
"strconv"
"bazil.org/fuse"
"bazil.org/fuse/fs"
@Zirak
Zirak / extract.js
Created June 26, 2015 21:17
Top 50 starred messages in JS room
var stars = [],
max = null;
moarStars('http://chat.stackoverflow.com/rooms/info/17/javascript/?tab=stars');
function moarStars(href) {
var xhr = new XMLHttpRequest()
xhr.open('GET', href);
xhr.responseType = 'document';
xhr.onload = function () {
console.log('load', href);
var tree = xhr.response;
function shouldParenthesize (code) {
try {
Function(code);
}
catch (e) {
if (e instanceof SyntaxError) {
try {
Function('(' + code + ')');
return true;
}

Make $$ return an array

Right now $$ returns a static (non-live) NodeList, but we want to use array functions on it. Let’s make it work.

Find where console functions live

third_party/WebKit/Source/core/inspector/InjectedScriptSource.js

Wrap the call

var res;
if (this._canQuerySelectorOnNode(opt_startNode))
    res = opt_startNode.querySelectorAll(selector);
@Zirak
Zirak / editors.md
Last active February 2, 2024 09:07
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 / improvements.md
Last active August 29, 2015 14:20
Bunch of ideas to improve the devtools

(of course, the dev tools are insanely awesome, but everything has its quirks).

Console

> { a: 4 }
4
> { a: 4, b: 5 }
SyntaxError
// why not figure out it's an object literal, auto-wrap in parentheses?
void V8InjectedScriptHost::internalConstructorNameMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
return;
v8::Local<v8::Object> object = info[0].As<v8::Object>();
v8::Local<v8::String> result = object->GetConstructorName(); // <-- bug here
if (!result.IsEmpty() && toCoreStringWithUndefinedOrNullCheck(result) == "Object") {
v8::TryCatch tryCatch;
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE chat(
msgid integer primary key,
time datetime,
userid integer,
username text,
avatar_url text,