Skip to content

Instantly share code, notes, and snippets.

View bdimcheff's full-sized avatar

Brandon Dimcheff bdimcheff

View GitHub Profile
From 374e89988be7084a3ee441468e88941eb53dee56 Mon Sep 17 00:00:00 2001
From: Brandon Dimcheff <[email protected]>
Date: Thu, 22 Apr 2010 10:48:14 -0400
Subject: [PATCH] keep downloads bar from making the window bigger
---
chrome/browser/cocoa/browser_window_controller.mm | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
require 'set'
class Array
# O(N)
def my_uniq
seen = Set.new
inject([]) do |uniqued, item|
uniqued << item unless seen.include? item
seen << item
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the mongodb data-store
# Description: starts mongodb using start-stop-daemon
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
class Foo
puts "in Foo's body"
def self.inherited(subclass)
puts "inherited #{subclass}"
end
end
class Bar < Foo
puts "in Bar's body" # after inherited
{ :action => :ehlo,
:ehlo => 'mail.example.org' }
{ :action => :mail_from,
:ehlo => 'mail.example.org',
:mail_from => '[email protected]' }
{ :action => :rcpt_to,
:ehlo => 'mail.example.org',
:mail_from => '[email protected]',
:rcpt_to => '[email protected]' }
{ :action => :data,
module Router
def self.included(base) # :nodoc:
base.extend ClassMethods
end
module ClassMethods
attr_reader :routes
def map(regex, options = {}, &block)
define_method "#{regex}", &block
--- lsi.rbBACK 2008-02-06 15:49:59.000000000 -0500
+++ lsi.rb 2008-02-06 15:58:26.000000000 -0500
@@ -287,7 +287,11 @@
s[ord] = 0.0 if s[ord] < s_cutoff
end
# Reconstruct the term document matrix, only with reduced rank
- u * Matrix.diag( s ) * v.trans
+ if $GSL
+ u * GSL::Matrix.diag( s ) * v.trans
+ else
def parse_record
# Remove all non-digits from numeric attributes.
# Required in order to store data in Fannie Format
phones = %w{
borrower_ssn
borrower_phone_cell
borrower_phone_home
borrower_phone_work
borrower_employer_phone
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
require 'cucumber/rake/task'
require 'spec/rake/spectask'
namespace :rcov do
Cucumber::Rake::Task.new(:cucumber) do |t|