Skip to content

Instantly share code, notes, and snippets.

View gist:7a293c6a7c4bd27cef7dcfe3538b7367
const std = @import("std");
const warn = std.debug.warn;
const fmt = std.fmt;
const mem = std.mem;
var alloc = &std.heap.DirectAllocator.init().allocator;
pub const Expr = union(enum) {
Literal: Literal,
};
View gist:04e2e921cb54474fcee0a6f20a1e3d98
const std = @import("std");
const warn = std.debug.warn;
const fmt = std.fmt;
const mem = std.mem;
var alloc = &std.heap.DirectAllocator.init().allocator;
pub const ExprType = enum {
Binary,
Literal,
View gist:8e1d2289cfbb3c842d61ebdddf0316f7
const std = @import("std");
const Food = enum {
Pretzel,
Cheese,
Cucumber,
};
pub fn main() !void {
const alloc = &std.heap.DirectAllocator.init().allocator;
View gist:8e98cf20714947c817c1e37dac58061b
### Keybase proof
I hereby claim:
* I am cgag on github.
* I am cgag (https://keybase.io/cgag) on keybase.
* I have a public key ASCdMKp9h-XuWWOZPnlJZar9aXF32-6PMDR26pd-3H86Ygo
To claim this, I am signing this object:
@cgag
cgag / test.zig
Last active Sep 10, 2017
ir.cpp err
View test.zig
The initial program I tried to run:
```
pub fn main() -> %void {
var m2 = &2;
%%io.stdout.printf("hello: {}\n", m2);
}
```
error:
View richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@cgag
cgag / log.go
Created May 22, 2016 — forked from cespare/log.go
Golang apache logging
View log.go
type ApacheLogRecord struct {
http.ResponseWriter
ip string
time time.Time
method, uri, protocol string
status int
responseBytes int64
elapsedTime time.Duration
}
@cgag
cgag / gist:8031034
Created Dec 18, 2013
nginx and compojure/jetty
View gist:8031034
102
103 server {
104 listen 80;
105 server_name bookmarking.curtis.io;
106
107 location / {
108 expires 24h;
109 proxy_pass http://localhost:3000/;
110 sendfile on;
111 proxy_redirect off;
View tmp.clj
...
(defroutes basic-routes
(GET "/" [] (str "<a href=\"/test\">test</a>"))
(GET "/test" [] (friend/authenticated (home/index))))
(defroutes all-routes
basic-routes
<other routes>)
View car.cpp
class Car {
private:
void top () {
printf(" ________________________");
printf(" / | \\");
printf(" / | \\");
printf(" / | \\");