This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snippet ported from xboxdrv | |
{ // find endpoints | |
struct usb_config_descriptor *config; | |
struct usb_interface *interface; | |
struct usb_interface_descriptor *altsetting; | |
struct usb_endpoint_descriptor *endpoing; | |
for ( | |
config = dev->config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
// sanity check | |
// test for eight-bit-bytes | |
int main(int argc, char **argv) { | |
if (255 == UINT_LEAST8_MAX) { | |
printf("pass\n"); | |
return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.join(File.dirname(__FILE__),'helper') | |
describe 'The load order' do | |
it 'should not cause explosions when loading physics before arbiter' do | |
require 'physics' | |
require 'arbiter' | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "buffer.h" | |
/* statically allocate tests */ | |
#define TEST_MAX (2 << 8) | |
struct test { | |
struct test *next; | |
char *desc; | |
int pass; | |
} tests[TEST_MAX]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define pi 3.1415926535897932 | |
double sin(double a) { | |
double y; | |
double x = a / (pi / 2); | |
int fol = x; | |
int neg = (int)(x / 2) & 1; | |
int inv = (int)x & 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define FPS 30 | |
enum player_state { | |
PLAYER_HALT, | |
PLAYER_LEFT, | |
PLAYER_RIGHT, | |
PLAYER_DOWN, | |
PLAYER_UP | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
installed_gems = Gem::Dependency.new '', Gem::Requirement.default | |
missing = [] | |
# mind the short-hand, looping over installed gem specs | |
specs = Gem.source_index.search installed_gems | |
specs.each do |spec| | |
gem = Gem::Dependency.new spec.name, spec.version | |
# looping over gem dependencies | |
specs = Gem.source_index.search gem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c | |
index dbd6e89..c5d9ba9 100644 | |
--- a/amd64/src/wl/sys/wl_linux.c | |
+++ b/amd64/src/wl/sys/wl_linux.c | |
@@ -1418,7 +1418,7 @@ static void | |
_wl_set_multicast_list(struct net_device *dev) | |
{ | |
wl_info_t *wl; | |
- struct dev_mc_list *mclist; | |
+ struct netdev_hw_addr *ha; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# part-mount | |
# | |
# a quick and dirty script for mounting | |
# partitions of a disk image | |
# | |
if test $# -ne 3; then | |
echo Usage: $0 DISK-IMAGE PARTITION DIR; exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/ioctl.h> | |
#include <unistd.h> | |
#include "unicode_ascii_translation_table.c" | |
#define CSI "\x1B[" | |
int is_ascii_printable(char c) { | |
return (c > 0x1F) & (c != 0x7F); | |
} |