Skip to content

Instantly share code, notes, and snippets.

@onsi
onsi / error_filter_test.go
Created October 18, 2022 22:08
An error filter example
package foo_test
import (
"context"
"errors"
"reflect"
"testing"
"time"
. "github.com/onsi/ginkgo/v2"
@onsi
onsi / gist:38b0cbcd942c3cf674ac
Created February 10, 2015 04:18
etcd inconsistencies
On A:
`curl http://localhost:4001/v2/keys/v1/actual?quorum=true`
```
{"action":"get","node":{"key":"/v1/actual","dir":true,"nodes":[{"key":"/v1/actual/c9f57094-9308-463b-8da3-a27bac612471-423d6ce0-e5fc-4a02-b3c9-4316515f2823","dir":true,"modifiedIndex":5,"createdIndex":5},{"key":"/v1/actual/dc62aca9-797a-4399-960c-c8d8a6a559cc-04ce567f-0991-4dfe-84e8-40ece4831b5c","dir":true,"modifiedIndex":653312,"createdIndex":653312},{"key":"/v1/actual/luan","dir":true,"modifiedIndex":572522,"createdIndex":572522},{"key":"/v1/actual/vizzini-2-4668f081","dir":true,"modifiedIndex":663247,"createdIndex":663247},{"key":"/v1/actual/af04c4f7-7972-4f89-844a-17f14f8960f8-7098b2e3-b9d8-410c-a30e-e0878d7a31c4","dir":true,"modifiedIndex":653325,"createdIndex":653325},{"key":"/v1/actual/jim","dir":true,"modifiedIndex":409732,"createdIndex":409732},{"key":"/v1/actual/vizzini-3-fa29c4a0","dir":true,"modifiedIndex":679709,"createdIndex":679709},{"key":"/v1/actual/vizzini-2-b5db9744","dir":true,"modifiedIndex":663243,"createdIndex":6632
rep [INFO] 2m12.251141164s 15.1.19 rep-nats-server.nats-handler.bid-for-start.handling
==> executor/executor.stdout.log <==
executor [INFO] 2m12.251387692s 750 request.serving
{"method":"GET","request":"/resources/remaining"}
executor [INFO] 2m12.251430188s 750 request.done
{"method":"GET","request":"/resources/remaining"}
executor [INFO] 2m12.251631148s 752 request.serving
{"method":"GET","request":"/resources/total"}
executor [INFO] 2m12.251651116s 752 request.done
@onsi
onsi / experiments_test.go
Last active August 29, 2015 14:07
Go ordered semaphore
package experiments_test
import (
"fmt"
"sync"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@onsi
onsi / example_test.go
Created March 4, 2014 05:44
test_server
//something like...
var _ = Describe("A Server", func() {
var s *Server
BeforeEach(func() {
s = New()
s.Append(CombineHandlers(
VerifyRequest("GET", "/foo/bar"),
@onsi
onsi / modified_e2e_query_test.go
Last active December 31, 2015 11:19
e2e_basics_test suggestion
// +build e2e
// +build appengine
package hrd
import (
. "101loops/bdd"
"appengine/memcache"
_ "fmt"
)
@onsi
onsi / gist:7905121
Last active December 31, 2015 00:09
Filter allocations down to my pivots
Goto:
https://allocations.pivotallabs.com/accounts/3/person_allocations
Run:
pivotRegexp = /Shusta|Foley|Atira|Yulia|Onsi|Vinson/
$('tr').each(function() {n = $(this).children(".name").eq(0).text(); if (n && !pivotRegexp.test(n)) {$(this).hide()}})
@onsi
onsi / gist:1233018
Created September 21, 2011 19:13
OCMock argument matching compares classes incorrectly
#import "SpecHelper.h"
#import "OCMock.h"
#define EXP_SHORTHAND
#import "Expecta.h"
@interface AFakeObject : NSObject
- (void)callMe:(NSString *)name;
@end
@onsi
onsi / gist:1217435
Created September 14, 2011 18:56
@Property => synthesize = synthesize_
Find:
^\@property\s\(.*\)\s.*\s\*?(\w+);$
Replace:
$1 = $1_,