Skip to content

Instantly share code, notes, and snippets.

View johnboiles's full-sized avatar

John Boiles johnboiles

View GitHub Profile
@johnboiles
johnboiles / gist:776759
Created January 12, 2011 19:50
Getting OpenNI working on OSX
# Get OpenNI
git clone git://github.com/OpenNI/OpenNI.git
# Switch to unstable branch (only unstable supports osx atm)
git checkout unstable
# Follow the installation instructions in the Readme (they're pretty good)
# Get the forked version of the PrimeSense/Sensor module working (the official didn't seem to work)
git clone git://github.com/ros-pkg-git/Sensor.git
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");
@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>
// 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();
}
}
/* 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
*/
@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
@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 / 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: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
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];