This file contains hidden or 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
" UNIMPAIRED PLUGIN | |
" Bubble single lines | |
nmap <C-k> [e | |
nmap <C-j> ]e | |
" Bubble multiple lines | |
vmap <C-k> [egv | |
vmap <C-j> ]egv |
This file contains hidden or 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
vim_plugin_task "unimpaired", "git://github.com/tpope/vim-unimpaired.git" |
This file contains hidden or 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 FlatteableHash | |
def flatten(ancestor_names = []) | |
flat_hash = {} | |
each do |key, value| | |
names = Array.new(ancestor_names) | |
names << key | |
if value.is_a?(Hash) | |
value = FlatteableHash.new(value) |
This file contains hidden or 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
num = Math.abs(num) | |
// Java code | |
num = -1234 | |
positive = num.abs | |
# => 1234 |
This file contains hidden or 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
# e is a Google::Event with valid phone_numbers | |
irb(main):011:0> e.create_call_from_attrs | |
RESQUE SCHEDULED: Call 4fbd42c46eee0c0007000002 at 2012-05-31 17:53:00 UTC | |
=> #<Call _id: 4fbd42c46eee0c0007000002, _type: nil, created_at: 2012-05-23 20:04:20 UTC, updated_at: 2012-05-23 20:04:20 UTC, deleted_at: nil, google_event_id: BSON::ObjectId('4fbd35802697550007000003'), bridge_number: "6193262700", pin: "4031741", starts_at: 2012-05-31 17:53:00 UTC, ends_at: 2012-05-31 18:53:00 UTC, state: "scheduled", user_id: BSON::ObjectId('4f8f0e44f67a78000a00000a'), provider_id: BSON::ObjectId('4f8ce23a011b4d0007000002')> | |
irb(main):012:0> e.call | |
=> #<Call _id: 4fbd42c46eee0c0007000002, _type: nil, created_at: 2012-05-23 20:04:20 UTC, updated_at: 2012-05-23 20:04:20 UTC, deleted_at: nil, google_event_id: BSON::ObjectId('4fbd35802697550007000003'), bridge_number: "6193262700", pin: "4031741", starts_at: 2012-05-31 17:53:00 UTC, ends_at: 2012-05-31 18:53:00 UTC, state: "scheduled", user_id: BSON::ObjectId('4f8f0e44f67a78000a00 |
This file contains hidden or 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
credentials = Autodiscover::Credentials.new('<e-mail address>', '<password>') | |
client = Autodiscover::Client.new | |
services = client.get_services(credentials) | |
ews_url = services.ews_url | |
Viewpoint::EWS::EWS.endpoint = ews_url | |
Viewpoint::EWS::EWS.set_auth 'username','password' | |
#believe this fetches the primary calendar. Still need to figure out how to get the list of all calendars. | |
calendar = Viewpoint::EWS::Folder.get_folder(:calendar) |
This file contains hidden or 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
uri = URI('https://host.com/ews/exchange.asmx') | |
user = '' | |
passwd = '' | |
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| | |
request = Net::HTTP::Get.new(uri.request_uri) | |
t1 = Net::NTLM::Message::Type1.new() | |
request['Authorization'] = 'NTLM ' + t1.encode64 | |
response = http.request(request) |
This file contains hidden or 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
uri = URI('https://host.com/ews/exchange.asmx') | |
user = '' | |
passwd = '' | |
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| | |
request = Net::HTTP::Get.new(uri.request_uri) | |
t1 = Net::NTLM::Message::Type1.new() | |
request['Authorization'] = 'NTLM ' + t1.encode64 | |
response = http.request(request) |
This file contains hidden or 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
Call.where(:state.in => [:to_bill, :free]).all.each do |c| | |
c.billing_state = c.state | |
c.state = :scheduled | |
c.save! | |
end | |
Call.where(:billing_state => nil).each do |c| | |
c.update_attributes!(:billing_state => "unprocessed") | |
end |
This file contains hidden or 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 'github_api' | |
components = %w{ tag1 tag2 tag3 tag4 } | |
users = { | |
'github-username' => 'new-system-username' | |
} | |
assembla_issues = [] | |
client = Github.new login: 'user', password: 'password' |
OlderNewer