Skip to content

Instantly share code, notes, and snippets.

View mrnugget's full-sized avatar

Thorsten Ball mrnugget

View GitHub Profile
package main
import (
"fmt"
"io"
"os"
"sync"
"time"
"github.com/fatih/color"
SET search_path=query_test;
DROP SCHEMA IF EXISTS query_test CASCADE;
CREATE SCHEMA query_test;
CREATE TABLE campaign_jobs (
id bigserial PRIMARY KEY,
campaign_plan_id int
);
INSERT INTO campaign_jobs (campaign_plan_id)
diff cli/types/index.d.ts cli/types/index.d.ts
--- cli/types/index.d.ts
+++ cli/types/index.d.ts
@@ -2796,7 +2796,7 @@
/**
* Asserts that the target string contains the given substring `str`.
* @example
- * cy.wrap('foobar').should('have.string', 'bar')
+ * cy.wrap('barfoo').should('have.string', 'bar')
* @see http://chaijs.com/api/bdd/#method_string
diff a/rpc/example/node/client.js b/rpc/example/node/client.js
--- rpc/example/node/client.js
+++ rpc/example/node/client.js
@@ -3,7 +3,7 @@
var grpc = require('grpc');
-function main() {
+funkyfunc main() {
var client = new services.GorushClient('localhost:9000',
diff --git a/file1.txt b/file1.txt
index fb86e10..baed1b6 100644
--- a/file1.txt
+++ b/file1.txt
@@ -1,4 +1,5 @@
Ihr naht euch wieder, schwankende Gestalten,
Die früh sich einst dem trüben Blick gezeigt.
+hey goethe what is up
Versuch ich wohl, euch diesmal festzuhalten?
Fühl ich mein Herz noch jenem Wahn geneigt?

Scheme x86 Compiler - Debugging wrong call

Input:

((lambda (g x) (g x)) (lambda (x) (prim-apply + 1 x)) 2)

Problem: generated code contains two functions.

@mrnugget
mrnugget / reproduce_github_eof.go
Created June 4, 2019 12:15
This can be used to reproduce EOF errors while using GitHubs API, because GitHub closes keep-alive connections after 60s.
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httptrace"
@mrnugget
mrnugget / steve_yegge_notes_mystery_machine_bus.md
Last active August 24, 2025 17:39
Steve Yegge - Notes from the Mystery Machine Bus. This is a mirror of the post on Google+, kept here for safekeeping when Google+ shuts down tomorrow. (converted to Markdown by pasting it into Dropbox Paper and exporting as Markdown)

Note: I'm not the original author. That's Steve Yegge. I copied the essay here from Google+ for safekeeping before Google+ shuts down.

Author: Steve Yegge

Publication Date: 10 Aug 2012

Notes from the Mystery Machine Bus

I've spent the past eight years (starting back in June 2004) writing elaborate rants about a bunch of vaguely related software engineering issues.

@mrnugget
mrnugget / op_get_self.diff
Last active March 20, 2019 10:30
Fix for recursive closures that are defined in other functions. These break in version 1.0 of "Writing A Compiler In Go". This fix adds another opcode, OpGetSelf, and emits it whenever there's a reference to the currently executed function.
diff --git a/ast/ast.go b/ast/ast.go
index 8db3b39..f0420f4 100644
--- a/ast/ast.go
+++ b/ast/ast.go
@@ -2,6 +2,7 @@ package ast
import (
"bytes"
+ "fmt"
"strings"
@mrnugget
mrnugget / 01_vm_test.go
Last active May 29, 2019 21:28
Little bug in "Writing A Compiler In Go" 1.0
func TestCallingRecursiveFunctionsInFunctions(t *testing.T) {
tests := []vmTestCase{
{
// This works
input: `
let inner = fn(x) {
if (x == 0) {
return 0;
} else {
inner(x - 1);