Skip to content

Instantly share code, notes, and snippets.

View 1dolinski's full-sized avatar

Chris Dolinski 1dolinski

View GitHub Profile
// <---------- [ Program Overview ] ---------->
// Take BND all BND pages from FIS and put them into excel
using System;
// fundamental classes and base classes for value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions
using Microsoft.Office.Interop.Excel;
// using the Excel namespace (added in Microsoft Excel 11.0 Object )
using System.Reflection;
[1] pry(#<UsersController>)> user.class
=> ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_Activity
[2] pry(#<UsersController>)> activities.class
=> ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_Activity
[3] pry(#<UsersController>)> (user + activities).class
=> Array
scope :reject_previewed, ->() { where(:preview => 0)}

This is in a post index view file

<input type="hidden" id="dp" />

this is in the posts.js file

 $("#dp").datepicker({
- postList.each do |post|
.row-fluid
.span2
= post.title
.span3
= post.description
def prime_factors(n)
return [] if n == 1
factor = (2..n).find {|x| n % x == 0}
binding.pry
[factor] + prime_factors(n / factor)
binding.pry
end
puts prime_factors(600851475143).max
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
def euler4
8
end
require 'rspec'
describe :euler4 do
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (4.0.0)
In Gemfile:
acts_as_commentable_with_threading (>= 0) ruby depends on
activesupport (~> 3.0) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
def self.build_from(obj, user_id, comment)
new \ # what is this \ doing here?
:commentable => obj,
:body => comment,
:user_id => user_id
end