Skip to content

Instantly share code, notes, and snippets.

@tomtoday
tomtoday / gist:3a805ca61d9fc7212222
Created May 1, 2014 15:45
output of `cfx run` on OS X 10.9.2
(addon-sdk-1.16) ~/Documents/code/drivetrain/imyne/my-addon$ cfx --verbose run
A given cfx option has an inappropriate value:
ZIP does not support timestamps before 1980
(addon-sdk-1.16) ~/Documents/code/drivetrain/imyne/my-addon$ python -V
Python 2.7.5
@tomtoday
tomtoday / notes_week2.md
Last active August 29, 2015 13:58
Notes - Week 2- Smart Factory - Intro to Rails Spring 2014

Smart Factory - Intro to Rails Spring 2014

Week 2

ActiveRecord

Rails Guides

basics

@tomtoday
tomtoday / AS_0.2.13_exception
Created October 16, 2013 21:01
"Exception in plugin Android Support." when trying to open an xml layout file
java.lang.NullPointerException
at com.android.tools.idea.configurations.ConfigurationManager.getTargets(ConfigurationManager.java:232)
at com.android.tools.idea.configurations.ConfigurationManager.getDefaultTarget(ConfigurationManager.java:315)
at com.android.tools.idea.configurations.ConfigurationManager.getTarget(ConfigurationManager.java:380)
at com.android.tools.idea.configurations.Configuration.getTarget(Configuration.java:476)
at com.android.tools.idea.configurations.TargetMenuAction.updatePresentation(TargetMenuAction.java:51)
at com.android.tools.idea.configurations.TargetMenuAction.<init>(TargetMenuAction.java:38)
at com.android.tools.idea.configurations.ConfigurationToolBar.createActions(ConfigurationToolBar.java:89)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel.addConfigurationActions(AndroidDesignerEditorPanel.java:218)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel.addActions(AndroidDesignerEditorPanel.java:189)

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

// Usage example:
// input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png
//
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
@end
MyGreatApp.OrderForm = function() {
//...
}
MyGreatApp.OrderForm.prototype ={
//...
initPromoCodeSubmit: function(){
// do stuff
}
}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => '25',
:domain => "mydomain.com",
:authentication => :plain,
:user_name => "xxxx",
:password => "xxxx"
}
<!-- Automatically resize a textarea's height (like Facebook) -->
<textarea id="comment" rows="1" cols="50"></textarea>
<script type="text/javascript" charset="utf-8">
function autoResize(fieldId) {
var length = $(fieldId).value.length;
if(length > 0) {
$(fieldId).rows = Math.floor(length / $(fieldId).cols) + 1;
# see http://ramblingsonrails.com/how-to-migrate-a-rails-app-from-attachment_fu-to-paperclip
require 'right_aws'
namespace :utils do
namespace :attachments do
task :initialize_s3 => :environment do
s3_config = YAML.load_file(File.join(File.dirname(__FILE__), '/../../config/amazon_s3.yml'))
s3_config = s3_config[RAILS_ENV].to_options
@s3 = RightAws::S3.new(s3_config[:access_key_id], s3_config[:secret_access_key])