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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.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
describe('conditional testing', function() { | |
it('should be able to test conditionally', function() { | |
browser.get('http://www.angularjs.org'); | |
element(by.css('.theresnowaythisclassexists')).then( | |
function elementExists() { | |
expect(false).toBe(true); | |
}, | |
function elementDoesNotExist() { | |
expect(true).toBe(true); | |
} |
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
./configure \ | |
--host="arm-apple-darwin" \ | |
--enable-static \ | |
--disable-shared \ | |
--disable-dependency-tracking \ | |
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \ | |
CPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-cpp-4.2 \ | |
CXXCPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-cpp-4.2 \ | |
CXX=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \ | |
AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar \ |
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
- (BOOL)directoryIsEmpty:(NSString *)path { | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
if ([[fileManager directoryContentsAtPath:path] count] > 0) | |
return NO; | |
else | |
return YES; | |
} | |
- (BOOL)directoryIsEmpty:(NSString *)path { | |
NSFileManager *fileManager = [NSFileManager defaultManager]; |
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
// Interrupt service routine called to generate PWM compare values | |
ISR(TIMER1_COMPA_vect) { | |
// unsigned long == 32-bit | |
unsigned long sine_0, sine_1; | |
// These are the two ADC 'readings'. I've added a check that ensures that each remains >= 1023. | |
unsigned long reading_0 = (unsigned long) adc_readings[0] > 1023 ? 1023: (unsigned long) adc_readings[0]; | |
unsigned long reading_1 = (unsigned long) adc_readings[1] > 1023 ? 1023: (unsigned long) adc_readings[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
#include <stdint.h> | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
#include <avr/pgmspace.h> | |
// Uncomment to enable debugging messages and values | |
#define DEBUG | |
uint16_t adc_readings[8]; | |
uint8_t digital_output = 11; // (PCINT22/OC0A/AIN0)PD6, Arduino Digital Pin 11 |
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
get '/foo' do | |
p 'in /foo' | |
redirect to('/bar') | |
end | |
get '/bar' do | |
p 'in /bar' | |
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
class Widget < ActiveRecord::Base | |
has_one :framework | |
end | |
class Framework < ActiveRecord::Base | |
belongs_to :widget | |
has_one :detail, :polymorphic => true | |
end | |
class InformationalFramework < ActiveRecord::Base |