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
# | |
# Monkey patch for "options_for_select", which forces a title attribute on the option which is the same as the text | |
# value which will be displayed in the select box. | |
# | |
# For what purpose, you ask? Well, it's like this. Selects have fixed widths and cannot be made to expand to fill | |
# available space :-p so you must choose a width when creating it, and hope for the best. If the data to be | |
# displayed in the select is too wide, then you just can't see the whole thing. With this patch, you will at least | |
# have access to the entire string as as hover-text, using the title attribute. | |
# | |
# If you don't like this, then just delete this file from the plugin, and you will be back to normal. |
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
Starts with prototype in header: | |
void* _CalcImageBlobParam( | |
void *pBlob, | |
PERFECTLYCLEARCALLBACK callbackfn = NULL, | |
void *pUserData = NULL | |
); | |
Modified for use in Objective-C: |
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
// From: | |
// http://www.stone.com/The_Cocoa_Files/Thanks_A_Bundle_.html | |
// here's how we determine the size of the actual image in the ImageView: | |
// I reused this code from PhotoToWeb, since it worked already! | |
- (float)photoReduction { | |
NSSize size = [[self image] size]; | |
NSRect iFrame = [self bounds]; | |
if (NSWidth(iFrame) > size.width && NSHeight(iFrame) > size.height) return 1.0; // it fits |
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
ignore_access_control_helper.rb: | |
shared_examples_for "IgnoreAccessControl" do | |
before(:each) do | |
controller.stub!(:current_user).and_return(mock(:has_role? => true)) | |
end | |
end | |
users_controller_spec.rb: |
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
def setup_alarm_notification(for_day, with_switch) | |
alarm_date = App::Persistence[for_day] | |
alarm_is_set = App::Persistence[with_switch]; | |
if (alarm_is_set && alarm_date && (alarm_date > Time.now)) | |
local_notification = UILocalNotification.alloc.init | |
local_notification.fireDate = NSDate.dateWithString( alarm_date.to_s ) | |
local_notification.alertBody = "Time to get up! #{alarm_date.strftime('%H:%M')}" | |
local_notification.soundName = UILocalNotificationDefaultSoundName | |
local_notification.applicationIconBadgeNumber = 1 |
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
ViewIdentifier = 'ViewIdentifier' | |
def mapView(mapView, viewForAnnotation:beer) | |
if view = mapView.dequeueReusableAnnotationViewWithIdentifier(ViewIdentifier) | |
view.annotation = beer | |
else | |
view = MKAnnotationView.alloc.initWithAnnotation(beer, reuseIdentifier:ViewIdentifier) | |
view.image = UIImage.imageNamed('signpost.png') | |
view.canShowCallout = true | |
# view.animatesDrop = true | |
button = UIButton.buttonWithType(UIButtonTypeDetailDisclosure) |
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 file goes in config/initializers | |
require 'bootstrap_form_builder' | |
# Make this the default Form Builder. You can delete this if you don't want form_for to use | |
# the bootstrap form builder by default | |
ActionView::Base.default_form_builder = BootstrapFormBuilder::FormBuilder | |
# Add in our FormHelper methods, so you can use bootstrap_form_for. | |
ActionView::Base.send :include, BootstrapFormBuilder::FormHelper |
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
<div class="navbar navbar-fixed-top"> | |
<div class="navbar-inner"> | |
<div class="container"> | |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</a> | |
<a class="brand" href="../">Calgary FieldTrips</a> | |
<div class="nav-collapse" id="main-menu"> |
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
group :development, :test do | |
gem 'jasmine' | |
gem 'jasmine-phantom' | |
# Works with the asset pipeline | |
gem 'jasmine-jquery-rails' | |
end |
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
$ cap deploy:setup | |
LoadError: load error: openssl -- java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DEREncodable | |
require at org/jruby/RubyKernel.java:1027 | |
(root) at /Users/lori/.rvm/gems/jruby-1.7.2@rails3-bootstrap-devise-cancan/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2 | |
require at org/jruby/RubyKernel.java:1027 | |
(root) at /Users/lori/.rvm/gems/jruby-1.7.2@rails3-bootstrap-devise-cancan/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:1 | |
require at org/jruby/RubyKernel.java:1027 | |
(root) at /Users/lori/.rvm/gems/jruby-1.7.2@rails3-bootstrap-devise-cancan/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2 | |
require at org/jruby/RubyKernel.java:1027 | |
(root) at /Users/lori/.rvm/gems/jruby-1.7.2@rails3-bootstrap-devise-cancan/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1 |
OlderNewer