Skip to content

Instantly share code, notes, and snippets.

View nooga's full-sized avatar
😎

Marcin Gasperowicz nooga

😎
View GitHub Profile
struct message {
unsigned foo;
unsigned bar;
unsigned LEN;
unsigned baz;
unsigned fizz;
/* byte[] payload <-- LEN bytes long */
};
byte field
offset
0 +---------+
|command |
4 +---------+
|arg a |
8 +---------+
|arg b |
12 +---------+
$ laser -t rex
.-=-==--==--.
..-==" ,'o`) `.
,' `"' \
: ( `.__...._
| ) / `-=-.
: ,vv.-._ / / `---==-._
\/\/\/VV ///88`;' / `.
! aaaaaaaaaaaaaaaa
"""""""" # cccccc
cc ddddddddd %% ee
eeeeeeeeeeeeeeeeee
eeee & fffffffff '
gg ((((((((((((((
((((((((((( H hhh
))))))))))))))))))
))))))) I iiiiiiii
iiii +++ , lllllll
@nooga
nooga / gist:1205816
Created September 9, 2011 09:16
An attempt to mimic OOP syntax in C
#include <stdlib.h>
#include <stdio.h>
// How it should look like:
/**
class Point {
int x,y;
new(int, int) {...};
void moveBy(Point) {...};
@nooga
nooga / gist:1206470
Created September 9, 2011 15:08
Grammar for C
/* $Id: parser.y,v 1.4 1997/11/23 12:52:22 sandro Exp $ */
/*
* Copyright (c) 1997 Sandro Sigala <ssigala@globalnet.it>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@nooga
nooga / test.cljs
Last active September 28, 2015 15:43
(defonce state (atom {:items [{:name "apple" :tasty true}
{:name "shoe" :tasty false}
{:name "glue" :tasty true}]}))
(defn toggle-tasty [name]
;... swap! :items
)
(defn item [i]
[:div [:span (:name i)]
/* category.js */
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId;
var Category = new Schema({
...
});
Category.statics.foobar = function() {
@nooga
nooga / ostatnideadline.txt
Created October 12, 2012 10:11
Piosenka "Ostatni Deadline"
"Ostatni Deadline" (w oparciu o "Ostatnia Nocka" by Maciej Maleńczuk & Yugopolis)
słowa: Marcin Gasperowicz
Boli mnie głowa a nie mogę spać, a GC
chociaż dokoła wszyscy już posnęli, F E
nie mogę siedzieć a nie mogę wstać,
mija ostatni termin beznadziei.
ref.:
Tylko kod, kod, kod, płoną światła lamp,
@nooga
nooga / robot.js
Created December 4, 2012 15:55 — forked from AndreMeira/robot.js
skaicoo
//FightCode can only understand your robot
//if its class is called Robot
var id;
var Robot = function(robot) {
id = this.id;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;