This file contains 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
enum ID { | |
Standard(u16), | |
Extended(u32) | |
} | |
enum Payload { | |
Value { | |
length : u8, | |
data: [u8; 8] | |
}, | |
Remote(u8) |
This file contains 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
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<style> | |
#view { float: right; width: 75vw; height: 98vh; } | |
nav { float: left; width: 20vw; height: 98vh; } | |
#nav { height: 100%; max-height: 90vh; overflow-y: scroll; } | |
.active { font-weight: bold; } | |
</style> | |
<title>Book search</title> | |
<iframe name=bob id=view src=blank.html></iframe> | |
<nav> |
This file contains 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
<?php | |
#ini_set('display_errors',0); | |
header('Content-Type: application/json'); | |
interface SQL { function sql(); } | |
interface RecordSet{ function add(Field $f); function field($name,$as=''); function fields();} | |
class DB | |
{ | |
const USERNAME = 'root', PASSWORD = 'password'; | |
const HOST = 'localhost', DB_NAME='smf'; | |
const TABLE = "smf_%s"; |
This file contains 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
typedef unsigned char BYTE; | |
typedef unsigned short WORD; | |
typedef unsigned long LONG; | |
BYTE BYTE_get(BYTE **buf_ptr) { return *(*buf_ptr)++; } | |
void BYTE_put(BYTE **buf_ptr, BYTE value) { *(*buf_ptr)++ = value; } | |
void WORD_put(BYTE **buf_ptr, WORD value) | |
{ |
This file contains 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
/* | |
Module for communicating with C_CAN device on C8051F500 and F580. | |
*/ | |
#include "myPlatform.h" | |
#define __C_CAN_H 1 | |
# include "C_CAN.h" | |
#undef __C_CAN_H | |
// CAN0STAT masks |
This file contains 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
var Buffer = { | |
_for: function(n, cb){ for(var i = 0; i < n; i++) cb(i) }, | |
_to: function(x, size, cb) { | |
var v = new DataView(x), out = [], l = x.byteLength/size | |
this._for(l, function (i) { out[i] = v[cb](i*size) }) | |
return out | |
}, | |
toBytes: function(b) { return this._to(b, 1, 'getUint8') }, | |
toWords: function(b) { return this._to(b, 2, 'getUint16') }, |
This file contains 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
// detects strings whos bytes are greycoded | |
function greystring(str){ | |
var a, b | |
function bitcount(v){ | |
var c; | |
for (c = 0; v; c++) | |
v &= v - 1; | |
return c; | |
} | |
for(var i = 1; i < str.length; i++) |
This file contains 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
public static int Value(this Control _, NumberStyles s, IFormatProvider p) | |
{ | |
int d; | |
if (int.TryParse(_.Text, s, p, out d)) | |
return d; | |
return 0; | |
} | |
public static double Value(this Control _) | |
{ | |
double d; |
This file contains 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
This gist has moved to FallingBullets/lib.cs on branch algebra |
This file contains 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 <string.h> | |
#include <stdio.h> | |
enum ini_parts { | |
ini_section, ini_key, ini_value, | |
ini_section_start = '[', ini_section_end=']', | |
ini_key_value = '=', | |
ini_comment = ';' | |
}; |
OlderNewer