Skip to content

Instantly share code, notes, and snippets.

unit = UnitId("player")
power = UnitPower(unit, "FURY")
"Ty: READY
adam: Yes
adam: Get ready to get plowed in Ur ass Tyler
Ty: 2 in the pink, 1 in the stink. LEGGGOOOO
adam: Who r u a fan of
Ty: Giants but they are going to suck
adam: No they aren't
adam: Cruz is back
Champ: cruz is done
R-Dot: the
@mangantj
mangantj / gist:0732375585029a2eb67a
Last active October 23, 2017 07:27
Rails mysql to csv with no backing models
ActiveRecord::Base.connection.tables.each{ |table|
headers = ActiveRecord::Base.connection.execute("Select * from #{table} LIMIT 1").fields
CSV.open("#{table}.csv", "wb") do |csv|
csv << headers
ActiveRecord::Base.connection.execute("Select * from #{table}").each{ |row|
csv << row
}
end
}
context "creating stripe subscribe customer" do
before(:each) do
Stripe::Plan.stub(:create) {"1"}
@plan = Fabricate(:plan, skip_callbacks: true)
@organization = Fabricate(:organization)
end
it "should fail to create subscription and catch exception" do
@subscription = Fabricate.build(:subscription, plan: @plan, organization: @organization)
customer = double("customer")
def new
@contact = Contact.new
@address = Address.new
@e_mail_address = EMailAddress.new
@phone_number = PhoneNumber.new
@addresses = Address.find(:all)
@e_mail_addresses = EMailAddress.find(:all)
@phone_numbers = PhoneNumber.find(:all)
$(function () {
$("#setFeesToPaid").click(function () {
var checkedUnPaidFees = $("input[name=paid]:checked");
if (checkedUnPaidFees.length > 0) {
$.ajax({
url: "/Fees/SetFeesToPaid",
type: "POST",
dataType: "JSON",
data: JSON.stringify(collectCheckBoxIds(checkedUnPaidFees)),
contentType: 'application/json; charset=utf-8',
require 'csv'
f = File.open("churches.csv", "r")
csv_string = ""
import_string = CSV.generate do |csv|
CSV.foreach(f, :encoding => 'windows-1251:utf-8') do |row|
if row[1] && row[1].length == 8
if row[5]
address = row[5].gsub(/(?<!^|,)"(?!,|$)/, '')
end
<%= label_tag("currencies", "Currency:") %>
<%= f.select :currency_conversion_code, {} , {prompt: "Currency Selection"}, {:class => "currencies"} %>
let(:task1) { create(:task, :user => @u) }
let(:do_action) { delete :destroy, :id => task1.id }
it "should find the task" do
do_action
assigns[:task].should eq(task1)
end
function AttachCheckBoxListOnClickEvent(controlId) {
$("#" + controlId + " input").click(function () {
if ($(this).parent().find('input:checkbox:first').is(':checked')) {
if ($(this).is('checked') == false) {
$("#" + testStageCheckListControlId + " tbody td:first-child input:checkbox").removeAttr('checked');
}
else {
SelectAllCheckBoxes(controlId, true);
}
}