Skip to content

Instantly share code, notes, and snippets.

View johnboiles's full-sized avatar

John Boiles johnboiles

View GitHub Profile
@johnboiles
johnboiles / SITLonOSX.diff
Last active December 19, 2015 04:39
Patch for that allows compiling SITL version of ArduPilot on OSX (tested on 10.8.4). This makes the following changes * MSG_NOSIGNAL doesn't exist on OSX, instead it requires SO_NOSIGPIPE * The included assembler (as) and linker (ld) flags aren't supported on OSX versions of as and ld. This removes the flags if the uname is Darwin.
diff --git a/libraries/AP_HAL_AVR_SITL/UARTDriver.cpp b/libraries/AP_HAL_AVR_SITL/UARTDriver.cpp
index f99bb2f..3d9ff4e 100644
--- a/libraries/AP_HAL_AVR_SITL/UARTDriver.cpp
+++ b/libraries/AP_HAL_AVR_SITL/UARTDriver.cpp
@@ -33,6 +33,14 @@ using namespace AVR_SITL;
#define LISTEN_BASE_PORT 5760
+// On OSX, MSG_NOSIGNAL doesn't exist. The equivalent is to set SO_NOSIGPIPE
+// in setsockopt for the socket. However, if we just skip that, and don't use
diff --git a/Classes/Buttons/YKUIButton.m b/Classes/Buttons/YKUIButton.m
index bf5cdcd..18fdf2f 100644
--- a/Classes/Buttons/YKUIButton.m
+++ b/Classes/Buttons/YKUIButton.m
@@ -167,7 +167,7 @@
CGSize secondaryTitleSize = [_secondaryTitle sizeWithFont:(_secondaryTitleFont ? _secondaryTitleFont : _titleFont) constrainedToSize:constrainedToSize lineBreakMode:UILineBreakModeTailTruncation];
titleSize.height += roundf(secondaryTitleSize.height);
} else if (_secondaryTitlePosition == YKUIButtonSecondaryTitlePositionBottomLeftSingle) {
- CGSize secondaryTitleSize = [_secondaryTitle sizeWithFont:(_secondaryTitleFont ? _secondaryTitleFont : _titleFont)];
+ CGSize secondaryTitleSize = [_secondaryTitle sizeWithFont:(_secondaryTitleFont ? _secondaryTitleFont : _titleFont) constrainedToSize:constrainedToSize lineBreakMode:UILineBreakModeTailTruncation];
@johnboiles
johnboiles / gist:2090788
Created March 19, 2012 02:16
brew install -v gccxml
~/Programming > brew install -v gccxml
==> Checking out cvs://:pserver:[email protected]:/cvsroot/GCC_XML:gccxml
Updating /Users/johnb/Library/Caches/Homebrew/gccxml--cvs
/usr/bin/cvs up
cvs update: Updating .
cvs update: Updating GCC
cvs update: Updating GCC/config
cvs update: Updating GCC/config_cmake
cvs update: Updating GCC/config_cmake/gcc_asm_tests
cvs update: Updating GCC/gcc
@johnboiles
johnboiles / gist:2090649
Created March 19, 2012 02:12
brew doctor
~/Programming > brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
@johnboiles
johnboiles / gist:2090622
Created March 19, 2012 02:11
brew install gccxml
~/Programming/gccxml > brew install gccxml
==> Checking out cvs://:pserver:[email protected]:/cvsroot/GCC_XML:gccxml
Updating /Users/johnb/Library/Caches/Homebrew/gccxml--cvs
cvs update: Updating .
cvs update: Updating GCC
cvs update: Updating GCC/config
cvs update: Updating GCC/config_cmake
cvs update: Updating GCC/config_cmake/gcc_asm_tests
cvs update: Updating GCC/gcc
cvs update: Updating GCC/gcc/config
@johnboiles
johnboiles / buildlibxml.diff
Created May 25, 2011 22:37
Patch for lxml's buildlibxml.py to remove ppc support for XCode4
diff --git a/buildlibxml.py b/buildlibxml.py
index bfcf3e4..b09e0e2 100644
--- a/buildlibxml.py
+++ b/buildlibxml.py
@@ -1,5 +1,5 @@
-import os, re, sys
-from distutils import log, sysconfig
+import os, re, sys, subprocess
+from distutils import log, sysconfig, version
/* Name: main.c
* Author: John Boiles
* 17 July 2009
*
* Code to control AC lights using a pulse detection circuit and triac drivers. The ATTiny receives
* commands through the UART and sets up timing accordingly.
*
* DMX info from http://www.dmx512-online.com/packt.html
*/
// Check if it's a start value (0 for dmx)
if (in == 0){
// Get values for each light. Currently I'm just
// leaving this as 4, but in the future it could be
// more.
// TODO: we shoud have a configureable starting address for DMX
for(i = 0; i < NUMBEROFLIGHTS; i++){
Lights[i].intensity = USART_Receive();
}
}
@johnboiles
johnboiles / GHDark.dvtcolortheme
Created March 22, 2011 18:52
Gabriel Handford's GHDark theme, ported using to Xcode4 using mrevilme's script (https://gist.github.com/488120). Install in ~/Library/Developer/Xcode/UserData/FontAndColorThemes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
require("oosocks");
local connection = OOSock(IPPROTO_TCP);
function CallBack(socket, callType, callId, err, data, peer, peerPort)
Msg("Got a callback")
if(callType == SCKCALL_CONNECT and err == SCKERR_OK) then
print("Connected to google.com.au, YAY!");
socket:SendLine("GET /index.html HTTP/1.1");
socket:SendLine("Host: localhost");