Skip to content

Instantly share code, notes, and snippets.

int main() {
UBRR0H = 0;
UBRR0L = 52;
UCSR0B = _BV(TXEN0);
UCSR0C = _BV(USBS0) | _BV(UCSZ01);
stdout = &mystdout;
while(1) {
int x;
for (x = 1; x < 1024; x++) {
UBRR0L = x;
var io = require('socket.io');
var redis_options = {}; // read https://github.com/LearnBoost/socket.io/blob/master/lib/stores/redis.js
var store = new io.RedisStore(redis_options);
var server = io.listen(http_server,{store:store});
@cleverca22
cleverca22 / gist:7690326
Created November 28, 2013 11:13
hello_video modified to attempt to output YUV420 frames
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <stdbool.h>
#include <v3d2.h>
@cleverca22
cleverca22 / leak.js
Created June 24, 2014 16:54
demo a leak in mongoose
var mongoose = require('mongoose');
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
var secondLevel = new Schema({
count:Number
});
var topLevel = new Schema({
list:[secondLevel]
});
var mongoose = require('mongoose');
mongoose.Types.ObjectId.prototype.toProtobuf = function () {
return new Buffer(this.id,'binary');
}
@cleverca22
cleverca22 / output.txt
Last active August 29, 2015 14:13
conversion problem
********* Start testing of TestCase *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS : TestCase::initTestCase()
QDEBUG : TestCase::convert(201) 201
QDEBUG : TestCase::convert(201.6) 201.6
PASS : TestCase::convert()
PASS : TestCase::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestCase *********
{ lib, config, pkgs, ... }:
{
services = {
toxvpn.enable = true;
toxvpn.localip = "192.168.123.10";
};
imports = [ <nixpkgs/nixos/modules/profiles/all-hardware.nix> "/etc/nixos/toxvpn_module.nix" ];
}
{ lib, config, pkgs, ... }:
let
commonPackages = with pkgs; [ wget screen vim nix-repl usbutils nox ];
perArchConfig = if builtins.currentSystem == "armv6l-linux" then {
FS = {
"/nix/var/nix/profiles" = { device="/nix/var/nix/profiles.arm"; options="bind"; };
};
} else {
FS = {
{ lib, config, pkgs, ... }:
{
nixpkgs.config = {
packageOverrides = pkgs: rec {
pixman = pkgs.stdenv.lib.overrideDerivation pkgs.pixman (oldAttrs: {
# bypass a gcc 4.9 bug
configureFlags = "--disable-arm-iwmmxt";
});
};
};