Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Books stevebooks

View GitHub Profile
View gist:0aa446e7ecb9add6112aeb0179b086e4
# 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`
View gist:3a1d09c1c8bb5c0d07fb
f = File.new('input.txt','r')
@output = File.new('output.txt','w')
@last_names = []
@first_names = []
load_databases()
f.readlines.each do |line|
View gist:bd54a9438feab866e8b2
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];
View gist:6125415
$('modal').html(<%= escapajdaf;lsj
$('modal').find('#new_thing')
setup_input_numberic_formatting(document.findByElementId('new_thing'))
View gist:6125321
#!/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
View gist:5817298
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')
View gist:5679398
#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
View gist:5600118
$.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)
View gist:5577602
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'
View gist:5556324
class Person
def self.get_name
persons_name
end
private
def self.persons_name
end
end
You can’t perform that action at this time.