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
| #!/usr/bin/env ruby | |
| require 'digest/md5' | |
| # Pass the directory path in which to | |
| # recursively search for duplicate JPEG files as the ARG. The uniqueness of each JPEG | |
| # is determined by its hexidigest. Duplicates are added to an array and | |
| # then deleted. | |
| ARGV.each do |path| | |
| unique_photos = Hash.new |
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 PagesController < ApplicationController | |
| def home | |
| @title = "Home" | |
| end | |
| def contact | |
| @title = "Contact" | |
| end | |
| def about | |
| @title = "About" | |
| 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 'spec_helper' | |
| describe PagesController do | |
| render_views | |
| describe "GET 'home'" do | |
| it "should be successful" do | |
| get 'home' | |
| response.should be_success | |
| 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
| class DevicesController < ApplicationController | |
| # GET /devices | |
| # GET /devices.xml | |
| def index | |
| @devices = Device.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.xml { render :xml => @devices } | |
| format.json { render :json => @devices} |
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
| email = ARGV[0] | |
| password = ARGV[1] | |
| uri = URI.parse("https://google.com/accounts/ClientLogin") | |
| request = Net::HTTP::Post.new(uri.path) | |
| request.set_form_data({'Email'=> email, 'Passwd' => password,'accountType' | |
| => 'GOOGLE', 'service' => 'ac2dm', 'source' => 'myexample'}) | |
| Net::HTTP.new(uri.host, url.port).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
| require 'net/https' | |
| require 'uri' | |
| email = ARGV[0] | |
| password = ARGV[1] | |
| uri = URI.parse("https://google.com/accounts/ClientLogin") | |
| http = Net::HTTP::Post.new(uri.host, uri.port) | |
| http.set_form_data({'Email'=> email, 'Passwd' => password,'accountType' => 'GOOGLE', 'service' => 'ac2dm', 'source' => 'myexample'}) | |
| http.use_ssl = true if uri.scheme == "https" |
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 'net/https' | |
| require 'uri' | |
| uri = URI.parse("https://android.apis.google.com/c2dm/send") | |
| req = Net::HTTP::Post.new(uri.path) | |
| req.set_form_data({'registration_id'=> 'APA91bGrY8Fvy24MHOzxu1IIZYizn-OAAofilp-bkwJ2KYK2buBR3hc5QRL-8ji1QaOGqgsAO2VmgoZhRx9ekzS5SzExis2_A3242424242424', | |
| 'collapse_key' => '0', | |
| 'data.payload' => 'sample payload', | |
| 'GoogleLogin auth' => 'SID=DQAAALoAAABf_UIu8u5k8YWurUC9DSdDHNXNXmHCNFoIImp2vmoqdIpD1JkMhDTh2ui7Xuf9s5O2_qyYiZQdA_1qWi81W6UoXNOoMUYy9drV6HEibcRe37mhqlz87ETcttyIw8bdraUKvhLdTDYyPbHjIeiK6hdkYZnvkB7XZLxFR9s3SABX88R9ovPpeR1XJ7MatL22fN6CorxMrtbcs9VfvuOMJ3V7XPbutDDA85BHMp1iXo-HGDMkGPeE_kovi_xeLAfNpKQ |
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 'net/https' | |
| require 'uri' | |
| uri = URI.parse("https://android.apis.google.com/c2dm/send") | |
| req = Net::HTTP::Post.new(uri.path) | |
| data = {'registration_id'=> 'APA91bGrY8Fvy24MHOzxu1IIZYizn-OAAofilp-bkwJ2KYK2buBR3hc5QRL-8ji1QaOGqgsAO2VmgoZhRx9ekzS5SzExis2_AElOFbgjHW7XVjKv1wUOQdMM0kNWos_o8Nwr3d0rUGuM', | |
| 'collapse_key' => '0', | |
| 'data.payload' => 'sample payload'} | |
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 'net/https' | |
| require 'uri' | |
| uri = URI.parse("https://android.apis.google.com/c2dm/send") | |
| req = Net::HTTP::Post.new(uri.path) | |
| data = {'registration_id'=> '24323423423423ewfasfsfasfsfddsf', | |
| 'collapse_key' => '0', | |
| 'data.payload' => 'samplepayload'} | |
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 'net/https' | |
| require 'uri' | |
| uri = URI.parse("https://android.apis.google.com/c2dm/send") | |
| req = Net::HTTP::Post.new(uri.path) | |
| data = {'registration_id'=> 'APA91bGobYUMXTy5QX9J7fF1NZi9GatdiBqRlEWEHbaAUF3W51WNGuWcXffbr-N_dL6JVAHNMfSpitxyNA7TSGfsKMyPCGF2E37z2VmZWxtZrKTQhqHZfY', | |
| 'collapse_key' => '0', | |
| 'data.payload' => 'samplepayload'} | |
OlderNewer