Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
🎴

Jordan Orelli jordanorelli

🎴
View GitHub Profile
package main
import (
"time"
"net/http"
)
func panicLater() {
time.Sleep(time.Second)
panic("we dead now")
package main
import (
"fmt"
"net/http"
)
type handler struct {
shared string
}
@jordanorelli
jordanorelli / z.c
Created December 12, 2016 05:54
minimum viable cgo with a header file
int from_c() {
return 12;
}
diff --git a/examples/helloworld/helloworld/helloworld.pb.go b/examples/helloworld/helloworld/helloworld.pb.go
index c8c8942..f373533 100644
--- a/examples/helloworld/helloworld/helloworld.pb.go
+++ b/examples/helloworld/helloworld/helloworld.pb.go
@@ -72,6 +72,7 @@ const _ = grpc.SupportPackageIsVersion4
type GreeterClient interface {
// Sends a greeting
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
+ SayHelloAgain(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}
0 {36271 0 PlusOne}
10 {25474 39 FieldPathEncodeFinish}
1110 {10334 1 PlusTwo}
1111 {10530 11 PushOneLeftDeltaNRightNonZeroPack6Bits}
11000 {2942 8 PushOneLeftDeltaOneRightNonZero}
11010 {4128 4 PlusN}
110010 {1375 2 PlusThree}
110011 {1837 29 PopAllButOnePlusOne}
11011001 {471 10 PushOneLeftDeltaNRightNonZero}
11011010 {521 7 PushOneLeftDeltaOneRightZero}
This file has been truncated, but you can view the full file.
Symbols:
0 CBodyComponentBaseAnimating
1 CEntityIdentity
2 CPhysicsComponent
3 CRenderComponent
4 CBaseAnimating
5 CAnimationLayer
6 CBodyComponentBaseAnimatingOverlay
7 CBaseAnimatingOverlay
8 CEconItemAttribute
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- loopback/8 anywhere reject-with icmp-port-unreachable
ACCEPT icmp -- anywhere anywhere state NEW icmp echo-request
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:https state NEW
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
LOG all -- anywhere anywhere limit: avg 5/min burst 5 LOG level debug prefix "iptables_INPUT_denied: "
@jordanorelli
jordanorelli / ydiff
Last active July 22, 2019 13:05
diff yaml trees semantically
#!/usr/bin/env ruby
# diffs the contents of yaml files semantically. that is, ydiff will parse each
# yaml file and then diff their resulting trees, instead of attempting to diff
# the text. it's specifically for comparing directories of translations from
# Crowdin, so it's effectively only concerned with strings.
require 'pathname'
require 'rubygems'
require 'yaml'
@jordanorelli
jordanorelli / gist:b6f74daae7e38b5f4a55
Last active March 10, 2016 01:46
planetarium notes
# SYNTAX Example
# Set the orbit color of the 100 brightest satellites to blue:
100Brightest.prop.OrbitColor 0.0 0.0 0.0 1.0
# ------------------------------------------------------------------------------
# Chicxulub crater coordinates
# (use negative for west longitutde)
# 21.4000° N, 89.5167° W
package main
import (
"flag"
"fmt"
"net/http"
"net/http/httputil"
"os"
"time"
)