⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# usage: | |
# $ das_download.rb email password [download_directory] | |
require 'mechanize' | |
# gem 'mechanize-progressbar' | |
email = ARGV[0] or raise('Please provide the email address for your account') | |
password = ARGV[1] or raise('Please provide the password for your account') | |
path = (ARGV[2] || './').gsub /\//,'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mechanize' | |
@username = 'user@domain.com' | |
@password = 'hi2u' | |
@download_path = File.expand_path 'downloads' | |
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt' | |
unless File.directory? @download_path | |
puts "@{download_path} doesn't exist!" | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "#destroy_pendings" do | |
before(:each) do | |
@account1 = FactoryGirl.create(:account, domain: 'foobar', admin_attributes: valid_user, plan: FactoryGirl.create(:subscription_plan, :basic)) | |
@account2 = FactoryGirl.create(:account, domain: 'foobars', admin_attributes: valid_user, plan: FactoryGirl.create(:subscription_plan, :basic)) | |
@account1.delayed_deletion | |
end | |
context "when there are no accounts to be permanent deleted" do | |
it "should not delete any account" do | |
expect { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delayed_deletion | |
begin | |
Account.transaction do | |
update_column(:deleted_at, Date.current) | |
destroy_subscription | |
end | |
rescue Exception; end; | |
AccountAlertMailer.deletion_notification(admin).deliver | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '../../app/services/recurly_account_checker' | |
require 'recurly' | |
describe RecurlyAccountChecker do | |
let(:user) { stub } | |
let(:customer) { stub } | |
let(:customer_id) { -1 } | |
before do | |
user.stub(:customer_id) { customer_id } | |
Recurly::Account.stub(:find) { customer } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AccountDeletionJob | |
@queue = :account_deletion | |
# Warning .perform will destroy an account from the database. | |
def self.perform(account_id) | |
account = Account.find(account_id) | |
if account | |
Account.transaction do | |
begin | |
account.destroy! | |
AccountAlertMailer.deletion_notification(account).deliver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ReflectValueOnKeyUp(from, to, options) { | |
var options = options || {}; | |
var escape_string = options.escape_string || false; | |
$(from).keyup(function(){ | |
var that = $(this); | |
if (options.escape_string == true) { | |
$(to).val(escapeString(that.val())); | |
} else { | |
$(to).val(that.val()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// While you can edit this file, it's best to put your changes in | |
// "User/Preferences.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for | |
// example, in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open ~/.bash_profile | |
2. copy and paste LC_CTYPE="utf-8" | |
3. Execute mailcatcher |
OlderNewer