Skip to content

Instantly share code, notes, and snippets.

View samdmarshall's full-sized avatar
💭
I will be slow to respond.

Samantha Demi samdmarshall

💭
I will be slow to respond.
View GitHub Profile
/*
* arm_decode.c
* SDMSymbolTable
*
* Copyright (c) 2013, Sam Marshall
* 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 notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#define THUMB_16_BL_OP(data) (((data) & 0xFF00) >> 9) & 0x1F)
#define THUMB_16_BL_OP0(data) ((THUMB_16_BL_OP(data) >> 4) & 1)
#define THUMB_16_BL_OP1(data) ((THUMB_16_BL_OP(data) >> 3) & 1)
#define THUMB_16_BL_OP2(data) ((THUMB_16_BL_OP(data) >> 2) & 1)
#define THUMB_16_BL_OP3(data) ((THUMB_16_BL_OP(data) >> 1) & 1)
#define THUMB_16_BL_OP4(data) ((THUMB_16_BL_OP(data)) & 1)
#define THUMB_16_BL_LShiftLeft(data) (THUMB_16_BasicLogic(data) && (THUMB_16_BL_OP0(data) == 0 && THUMB_16_BL_OP1(data) == 0 && THUMB_16_BL_OP2(data) == 0) && THUMB_16_BL_MOVCHECK(data) != 0)
#define THUMB_16_BL_LShiftRight(data) (THUMB_16_BasicLogic(data) && (THUMB_16_BL_OP0(data) == 0 && THUMB_16_BL_OP1(data) == 0 && THUMB_16_BL_OP2(data) == 1))
#define THUMB_16_BL_AShiftRight(data) (THUMB_16_BasicLogic(data) && (THUMB_16_BL_OP0(data) == 0 && THUMB_16_BL_OP1(data) == 1 && THUMB_16_BL_OP2(data) == 0))
/*
* arm_decode.c
* SDMSymbolTable
*
* Copyright (c) 2013, Sam Marshall
* 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 notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
typedef struct SocketConnection {
bool isSSL;
union {
SSL *ssl;
uint32_t conn;
} socket;
} SocketConnection;
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#include "chord_type_menu.h"
#define MY_UUID { 0x63, 0xB8, 0x75, 0x5C, 0x3E, 0x16, 0x45, 0xF6, 0xB4, 0x63, 0x5E, 0x0B, 0x68, 0xAE, 0x56, 0x1A }
PBL_APP_INFO(MY_UUID,
"Chordinator", "Pinch Studios",
1, 0, /* App version */
#include <sys/sysctl.h>
#include <sys/types.h>
#include <mach/mach.h>
#include <mach/processor_info.h>
#include <mach/mach_host.h>
#include <stdlib.h>
#include <stdio.h>
processor_info_array_t cpuInfo, prevCpuInfo;
mach_msg_type_number_t numCpuInfo, numPrevCpuInfo;
#include <stdio.h>
#include <string>
using namespace std;
int main(){
static const char* val1 = "hello";
const char* val2 = "hello";
const string val3 = "hello";
char* pointer = (char*)val3.c_str();
@samdmarshall
samdmarshall / adium export.scpt
Created August 11, 2013 17:21
adium export contacts applescript
tell application "Adium"
repeat with aperson in (contacts whose blocked is false)
set fullname to display name of aperson
set username to name of aperson
set aservice to name of service of account of aperson
set wcount to count words of fullname
set fname to word 1 of fullname
set lname to ""
if wcount > 1 then
void myFunction(uint32_t *var) {
var;
return;
}
#pragma mark -
#pragma mark CGFloat
#pragma mark Trigonometric Functions
#define CGFloatCos(a) (CGFLOAT_IS_DOUBLE ? cos(a) : cosf(a))
#define CGFloatSin(a) (CGFLOAT_IS_DOUBLE ? sin(a) : sinf(a))
#define CGFloatTan(a) (CGFLOAT_IS_DOUBLE ? tan(a) : tanf(a))
#define CGFloatACos(a) (CGFLOAT_IS_DOUBLE ? acos(a) : acosf(a))
#define CGFloatASin(a) (CGFLOAT_IS_DOUBLE ? asin(a) : asinf(a))
#define CGFloatATan(a) (CGFLOAT_IS_DOUBLE ? atan(a) : atanf(a))