Skip to content

Instantly share code, notes, and snippets.

@anbublacky
anbublacky / python
Created May 19, 2011 13:41
python-webscraping
import urllib2
import re
import subprocess
from BeautifulSoup import BeautifulSoup, SoupStrainer
@anbublacky
anbublacky / gist:2971067
Created June 22, 2012 07:40
Facing Error while creating exe- Undefined method full_name
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib
/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib
/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557.
NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will
be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/RailsInstaller/Ruby1.9.3/lib
@anbublacky
anbublacky / gist:7794135
Created December 4, 2013 19:39
style error
*************Creating car make***************
{:style_array_element=>{:style=>{:model_year=>"2013", :division_id=>"44", :division_name=>"Aston Martin", :subdivision_id=>"8166", :subdivision_name=>"Aston Martin", :model_id=>"26283", :model_name=>"V12 Vantage", :style_id=>"360242", :auto_builder_style_id=>"w2013k100m5t1", :style_name=>"2dr Cpe", :style_name_without_trim=>"2dr Cpe", :trim_name=>nil, :manufacturer_model_code=>"-CPE-1", :base_msrp=>"180600.0", :base_invoice=>"0.0", :destination=>"2115.0", :true_base_price=>false, :price_state=>"Actual", :body_types=>{:body_type_id=>"1", :body_type_name=>"2dr Car", :primary=>true}, :passenger_doors=>"2", :market_class_id=>"22", :market_class_name=>"2-door Sub-Compact Passenger Car", :stock_photo_url=>"http://media.carbook.com/autoBuilderData/stockPhotos/15972.jpg", :consumer_friendly_model_name=>"V12 Vantage", :consumer_friendly_style_name=>"2dr Cpe", :consumer_friendly_drivetrain=>"Rear Wheel Drive", :consumer_friendly_body_type=>"2dr Car", :configuration_state=>{
@anbublacky
anbublacky / gist:7794179
Last active December 30, 2015 07:09
style code
task :import_car_style => [:environment] do
client = Savon.new('https://services.chromedata.com/AutomotiveConfigCompareService/AutomotiveConfigCompareService3?WSDL')
service = "AutomotiveConfigCompareService3"
port = "AutomotiveConfigCompareService3Port"
getstyle = "getStyles"
style = client.operation(service, port, getstyle)
order_availability = ["Fleet", "Retail"]
order_availability.each do |availability|
ModelDefinition.all.each do |f|
style.body = {:StylesRequest=>{:accountInfo=>{:accountNumber=>"xxx", :accountSecret=>"xxx", :locale=>{:country$
class ErrorsController < ApplicationController
def not_found
render :status => 404, :formats => [:html]
end
def server_error
render :status => 500, :formats => [:html]
end
end
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset="utf-8">
@anbublacky
anbublacky / youtube channel upload image
Created June 30, 2015 12:03
youtube channel upload image
#!/usr/bin/ruby
require 'rubygems'
gem 'google-api-client', '>0.7'
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/file_storage'
require 'google/api_client/auth/installed_app'
# This OAuth 2.0 access scope allows for read-only access to the authenticated