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 ExampleJob < ActiveJob::Base | |
| rescue_from(ErrorLoadingSite) do | |
| retry_job wait: 5.minutes, queue: :low_priority | |
| end | |
| def perform(*args) | |
| # Perform Job | |
| end | |
| 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 ExampleJob < ActiveJob::Base | |
| # Set the Queue as Default | |
| queue_as :default | |
| def perform(*args) | |
| # Perform Job | |
| end | |
| 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
| @WebMethod(operationName = "getInstaPic") | |
| public String getInstaPic(@WebParam(name = "username") String username) { | |
| String userImage = ""; | |
| String site_url = "http://www.instagram.com/" + username; | |
| try{ | |
| Connection.Response insta_response = Jsoup.connect(site_url).timeout(50000).execute(); | |
| Document insta_doc = insta_response.parse(); | |
| Elements meta_im = insta_doc.select("meta[property=og:image]"); | |
| if(!meta_im.isEmpty()){ |
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
| <?php | |
| ini_set("soap.wsdl_cache_enable",0); | |
| $values=array( | |
| "username" => "glcebru" | |
| ); | |
| $wsdl_url = "http://ebru:8080/WebServisOdevi/WebServis?wsdl"; | |
| $client = new SoapClient($wsdl_url); |
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
| @WebMethod(operationName = "getTwitPic") | |
| public String getTwitPic(@WebParam(name = "username") String username) { | |
| String userImage = ""; | |
| String site_url = "http://www.twitter.com/" + username; | |
| try{ | |
| Connection.Response twitter_response = Jsoup.connect(site_url).timeout(50000).execute(); | |
| Document doc = twitter_response.parse(); | |
| Elements img_element = doc.select("img.ProfileAvatar-image"); | |
| if(!img_element.isEmpty()){ |
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
| def index | |
| @shippings = Shipping.active.includes(:zones, :tiers).all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.json { render json: @shippings } | |
| end | |
| 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
| def index | |
| @shippings = Shipping.active.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.json { render json: @shippings } | |
| end | |
| 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
| @companies = Company.joins(:persons).where(:persons => { active: true } ).all | |
| @companies.each do |company| | |
| company.name | |
| 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
| @companies = Company.includes(:persons).where(:persons => { active: true } ).all | |
| @companies.each do |company| | |
| company.person.name | |
| 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
| > Post.new | |
| => #<Post id: nil, title: nil, created_at: nil, updated_at: nil, user_id: nil, published: true> |