Skip to content

Instantly share code, notes, and snippets.

ruby >& ~/Library/Logs/tm_treetop_debug <<END &
require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui"
begin
require "$TM_BUNDLE_SUPPORT/syntax_tree_viewer"
s = SyntaxTreeViewer.new_with_unknown_grammar
s.dialog if s
rescue Exception => error
TextMate::UI.alert(:warning, "You’ve discovered a bug", "Please report the following text: #{error}\n\n#{error.backtrace.join(%Q{\n})}")
#project.rb
has_many :usages
has_many :asset_orders
has_many :usages, :through => :requests
#request.rb
belongs_to :project
#usage.rb
belongs_to :request
// Contrived example. Your f() is presumably correct and should be returning a pointer
// to an unsigned short
unsigned short *f() {
return (unsigned short *)"foo";
}
// A simple g() that takes a pointer to a char and prints its string
void g(char *s) {
printf("Got: %s\n", s);
}
require 'test/unit'
class SubsectionGraph
# This gives us access to the class's singleton object which will sit between the actual Class structure and
# any instances and child classes
#
# If you're using metaid, this can be replaced by something like:
# meta_eval do
# def prefix(p = nil)
# ...
class CheckAssociationProcessor < ETL::Processor::RowProcessor
attr_reader :ids, :foreign_key
def initialize(control, configuration)
super
@foriegn_key = configuration[:foreign_key] || raise ArgumentError, ":foreign_key option required"
model = configuration[:model] || raise ArgumentError, ":model option required"
# Optional :conditions or :find_options
find_options = cond = (configuration[:conditions] ? {:conditions => cond} : configuration[:find_options]) || {}
set :additional_shared_paths, ["public/page_attachments", "public/excel_page_attachments"]
namespace :deploy do
after "deploy:update_code", "deploy:link_additional_shared_paths"
desc "Link directories to shared paths if they're in the additional_shared_paths variable"
task :link_additional_shared_paths do
additional_shared_paths.each do |path|
run "ln -nfs #{shared_path}/#{path} #{release_path}/#{path}"
end
end
String new_name = newNameGuess(old_opp.Name, new_date); //WHY THE FUCK IS THIS BLOWING UP?!?!?!?
// "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.Name"
// FUCKING GET IT THEN! YOU HAVE ACCESS TO THE GODDAMN DATABASE YOU PIECE OF CRAP!
// TODO: fix the above
/Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:296:in `map_data': undefined method `rszf' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:291:in `each'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:291:in `map_data'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:287:in `step'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:287:in `map_data'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:172:in `make_impl'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:196:in `get_best_mask_pattern'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:195:in `each'
from /Library/Ruby/Gems/1.8/gems/barby-0.3.1/vendor/rqrcode/lib/rqrcode/qrcode/qr_code.rb:195:in
class Admin::LabelsController < ApplicationController
def index
@search = Sunspot.new_search(Label)
@search.build do |q|
q.keywords(params[:keywords]) if params[:keywords].present?
q.with(:tracking_number, params[:tracking_number]) if params[:tracking_number].present?
q.with(:status, params[:status]) if params[:status].present?
q.order_by(:created_at, :desc)
q.facet :status
<!-- Actual javascript code sample attached to resume -->`
<html>
<body>
<script type="text/javascript">
document.write("<h1>Hello World!</h1>");
</script>
</body>
</html>