Sunday, October 9, 2011

Shopify API - Rails Connection

I spent a lot of time struggling trying to get my shopify private connection working.
For those of you who are also new to rails and shopify and are stuck at this point this is how I did it.



First of all go to your shop->apps->manage apps
and set up a Private app and look for your api_key and password you will need those to authenticate your connection.

Now let's take a look at an example code that asks for products.xml using the API





require 'net/https'

api = "your-api"
password = "your-password"

http = Net::HTTP.new('yourshop.myshopify.com')
#http.use_ssl = true (We do not need to use SSL)
http.start do |http|
  req = Net::HTTP::Get.new('/admin/products.xml')

  # we have to authenticate our
  # username and password
  req.basic_auth api, password
  resp, data = http.request(req) #data will be the xml returned by the server

end


Basically you need to use an authenticated connection, to do this I used the Net:HTTP module on ruby.

Saturday, October 8, 2011

Textmate env: ruby: No such file or directory

If you get this error on Textmate you've probably deleted ruby /usr/bin/ruby.
Find it, put it back there, and follow the rainbows.

Friday, October 7, 2011

Installing ruby on rails

I had to install ruby on rails for a new project I'm working on, it is supposed to be a super easy task, it took me a while though, there's many "not that good guides".
This is the one I recommend, it's perfect.

Got this error installing rails

file 'lib' not found

here's the solution

Tuesday, October 4, 2011

I'm starting my company

Simple Custom Solutions is the name.


I'm in the process of setting up my web developing company.
Feel free to come and check out the beta version.

http://www.simplecustomsolutions.com/beta

Some of the tools we plan on using for our projects are, Actionscript 3, HTML5, CSS, jQuery, python, Pyramid Framework with SQLAlchemy, and MySQL

Thursday, September 1, 2011

Font embedding Flex 4.5 (actionscript 3)


After working for a few hours on a brand new all customizable slideshow I'm developing for a website, I decided I wanted to embed some fonts into my code.
This is easy stuff, but my friends, there's a catch, reading around the internet I found there might be a bug with the transcoder.
The embedding code is the following
[Embed(source='assets/My Font.ttf',
fontName='myFont',
embedAsCFF='true'
)]
private var MyFont :Class;
Then you just have to use
textFormatter.font = myFont;
Last, but not least, in order for the transcoder to work nicely you will have to add the following lines into the flex-config under the compiler tag


<fonts>

  <managers>

     <manager-class>flash.fonts.AFEFontManager</manager-class>

     <manager-class>flash.fonts.BatikFontManager</manager-class>

     <manager-class>flash.fonts.JREFontManager</manager-class>

  </managers>

</fonts>


The actual font manager that's working is the AFEFontManager, so that's the one we want on the top. Though I read somewhere that some people managed to get it to work by changing the managers position on the list.

Don't forget to use


myTextField.embedFonts = true;

Another thing, I've seen that not all the fonts work, usually ttf will work but not always though. If anyone can explain me why is that it would be great.

Monday, August 29, 2011

I updated my profile (and some other stuff)

I haven't been blogging for a long time, and I don't actually know why am I starting again... I guess it's entertaining.
Anyhow I'm following a weird path of learning right now which consists on a mix of the Pythons Pyramid project and some AS3 developing I'm doing. Nothing good can come out of this. I'm gonna share soon some of my experience cos maybe someone is interested in following the ways of the voodoo maaaan.