Skip to content

Instantly share code, notes, and snippets.

View gist:2571982
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;
View gist:4124430
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 Nov 28, 2013
hello_video modified to attempt to output YUV420 frames
View gist:7690326
/*
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
View SDL_v3d2.c
#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 Jun 24, 2014
demo a leak in mongoose
View leak.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
var secondLevel = new Schema({
count:Number
});
var topLevel = new Schema({
list:[secondLevel]
});
View gist:c4673cb45b827190dee9
var mongoose = require('mongoose');
mongoose.Types.ObjectId.prototype.toProtobuf = function () {
return new Buffer(this.id,'binary');
}
@cleverca22
cleverca22 / output.txt
Last active Aug 29, 2015
conversion problem
View output.txt
********* 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 *********
View configuration.nix
{ 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" ];
}
View configuration.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 = {
View configuration.nix
{ 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";
});
};
};
You can’t perform that action at this time.