Skip to content

Instantly share code, notes, and snippets.

# Gem File Standards
#
# Organization
# Alphabetize gems within their grouping
# Default to `require: false` to prevent increasing the rails load time
# Be conservative in which group to place a gem
# Comment on the same line when needed, ignore the column width limit
#
# Versioning
# peg to the current version using `~> x.y`
f = File.new('input.txt','r')
@output = File.new('output.txt','w')
@last_names = []
@first_names = []
load_databases()
f.readlines.each do |line|
@stevebooks
stevebooks / gist:bd54a9438feab866e8b2
Created January 22, 2015 17:02
Olark Turbolinks
var olarkId = "<account-id>";
var id = window.setTimeout(function(){}, 0);
while (id--) {
window.clearTimeout(id);
}
for (var key in Object.keys(window)) {
if (key.indexOf('hbl') == 0 || key.indexOf('habla') == 0) {
clearTimeout(window[key]);
delete window[key];
$('modal').html(<%= escapajdaf;lsj
$('modal').find('#new_thing')
setup_input_numberic_formatting(document.findByElementId('new_thing'))
#!/usr/bin/ruby
require 'mysql'
begin
con = Mysql.new 'localhost', 'user12', '34klq*'
puts con.get_server_info
rs = con.query 'SELECT VERSION()'
puts rs.fetch_row
form = $('#option_expense_report')
when drop element
certificateId = element.data('certificate-id')
html += '<input type="hidden" id= value="' + certificateId + '" name="option_expense_report[certificates][]">'
form.append($(html))
$('a.certificate_link').click ->
certId = $(this).date('certificate-id')
#Fix certificates that have a duplicate name
#Captable.where(id: 990).find_each do |cap|
Captable.find_each do |cap|
results = {}
cap.equity_certificates.find_each do |s|
puts "Cert ID: #{s.id}"
name = s.name.strip
if results.has_key?(name)
results[name] << s
else
$.ajax
url: "/sheets/1" #+ @extraUrlParams
type: "PUT"
contentType: "application/json"
data: JSON.stringify([change])
dataType: "json"
success: (data, textStatus, jqXHR) =>
$('#sheet-errors').hide('slow') #if there are errors
#handleUpdateResponse(data)
this.receivedAjax(data)
NoMethodError (undefined method `total_preferences_per_as_converted_share=' for #<EquityCertificate:0x007fde6a0ab108>):
app/models/equity_certificate.rb:319:in `set_total_preferences_per_as_converted_share'
app/models/equity_certificate.rb:81:in `adjust_fields'
app/models/equity_certificate.rb:50:in `set_fields'
app/models/transaction/certificate_transaction.rb:122:in `find_or_create_certificate'
app/controllers/transactions_controller.rb:43:in `update'
config/initializers/quiet_assets.rb:7:in `call_with_quiet_assets'
class Person
def self.get_name
persons_name
end
private
def self.persons_name
end
end