MISC
Hello my name is

  Michael Grosser



 Rathershort.com
I18nData

    Language – select



    Country – select





    Rails default = Full name = madness!

I18nData

    185 Language codes (iso 639 - 2 letter)


    in 66 Languages
    246 Country codes (iso 3166 - 2 letter)
...
I18nData

    I18nData.countries #{'DE'=>'Germany'}



    I18nData.countries('DE') #{'DE'=>'Deutschland'}





    I18n...
I18nData

    github.com/grosser/i18n_data

Smusher

    smusher /apps/ts/public/images


    smushing /apps/images/facebook_icon.png
    2887 -> 132                ...
store_with_default_protocol

    class User < ActiveRecord::Base


     store_with_default_protocol 'http', :website,...
...
RPX!

    OpenId = complicated + non-universal



    OpenId is for nerds



    RPX is for the masses

RPX!

    Popup or Embed

RPX!

    <=RPXNow.embed_code(


     'mywebsite',rpx_token_sessions_url
    )%>


    <%=RPXNow.popup_code(


     'Log...
RPX!

    def rpx_token


     data = RPXNow.user_data(
      params[:token],'YOUR RPX API KEY')

     self.current_user ...
RPX!

    Mappings → 1 user, N-Identities





    RPXNow.map( identifier,primary_key,'KEY')





    RPXNow.unmap(ident...
RPX!

    RPXNow.com





    github.com/grosser/rpx_now

Programming Rubies

    Programming Pearl rewritten in Ruby



    Readable + understandable

Programming Rubies

    Make a choice....



    int main(void){


      set S;
      set::iterator j;
      string t;
 ...
Programming Rubies

    Ruby + Markdown + Parser = HTML + PDF



    ### Unique words


    Show all words that are insi...
Programming Rubies

    Single large, printable file

Programming Rubies

    Contribute



    Review



    Enjoy



    github.com/grosser/programming_pearls

Upcoming SlideShare
Loading in …5
×

MISC TOPICS #2: I18n Data Programming Pearls Random Records Rpx Now Susher Store With Default Protocol

1,075 views
1,000 views

Published on

My quick & dirty presentation for Rug-b, covering my latest ruby adventures

Published in: Technology
2 Comments
0 Likes
Statistics
Notes
  • the problem is solved...
    using

    user_data(params[:token],:apiKey=>'4019e3c7149bac89114ef8c1ae6ab36bc4a8e795')

    instead of

    user_data(params[:token],'4019e3c7149bac89114ef8c1ae6ab36bc4a8e795')

    worked perfect :D
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • data = RPXNow.user_data(params[:token],'4019e3c7149bac89114ef8c1ae6ab36bc4a8e796')

    after this line it shows error:
    TypeError in UsersController#create

    can't convert Symbol into String

    Rails.root: E:/ruby/magnet_janrain
    Application Trace | Framework Trace | Full Trace

    app/controllers/users_controller.rb:16:in `create'

    Request

    Parameters:

    {'token'=>'73f84519b97cc85fe6117123f4f2d38efae1267a'}

    Show session dump

    Show env dump
    Response

    Headers:

    None
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
1,075
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
2
Comments
2
Likes
0
Embeds 0
No embeds

No notes for slide

MISC TOPICS #2: I18n Data Programming Pearls Random Records Rpx Now Susher Store With Default Protocol

  1. 1. MISC
  2. 2. Hello my name is Michael Grosser   Rathershort.com
  3. 3. I18nData Language – select  Country – select  Rails default = Full name = madness! 
  4. 4. I18nData 185 Language codes (iso 639 - 2 letter)  in 66 Languages 246 Country codes (iso 3166 - 2 letter)  in 85 Languages
  5. 5. I18nData I18nData.countries #{'DE'=>'Germany'}  I18nData.countries('DE') #{'DE'=>'Deutschland'}  I18nData.languages('DE') #{'DE'=>'Deutsch'}  Backwards: what is ”China” → 'ZH' 
  6. 6. I18nData github.com/grosser/i18n_data 
  7. 7. Smusher smusher /apps/ts/public/images  smushing /apps/images/facebook_icon.png 2887 -> 132 = 4% smushing /apps/images/myspace_icon.png 3136 -> 282 = 8% -c => convert gifs to smaller png  github.com/grosser/smusher 
  8. 8. store_with_default_protocol class User < ActiveRecord::Base  store_with_default_protocol 'http', :website,... end github.com/grosser/store_with_default_protocol 
  9. 9. RPX! OpenId = complicated + non-universal  OpenId is for nerds  RPX is for the masses 
  10. 10. RPX! Popup or Embed 
  11. 11. RPX! <=RPXNow.embed_code(  'mywebsite',rpx_token_sessions_url )%> <%=RPXNow.popup_code(  'Login here...', 'mywebsite', rpx_token_sessions_url,:language=>'de') %>
  12. 12. RPX! def rpx_token  data = RPXNow.user_data( params[:token],'YOUR RPX API KEY') self.current_user = User.find_by_identifier( data[:identifier]) || User.create!(data) redirect_to '/' end
  13. 13. RPX! Mappings → 1 user, N-Identities  RPXNow.map( identifier,primary_key,'KEY')  RPXNow.unmap(identifier,primary_key,'KEY')  RPXNow.mappings(primary_key,'API KEY') 
  14. 14. RPX! RPXNow.com  github.com/grosser/rpx_now 
  15. 15. Programming Rubies Programming Pearl rewritten in Ruby  Readable + understandable 
  16. 16. Programming Rubies Make a choice....  int main(void){  set S; set::iterator j; string t; while (cin >> t) S.insert(t); for (j = S.begin(); j != S.end(); ++j) cout << *j << quot;nquot;; return 0;} puts input.readlines(' ').uniq * quot;nquot; 
  17. 17. Programming Rubies Ruby + Markdown + Parser = HTML + PDF  ### Unique words  Show all words that are inside a given text include 1 #----excerpt  puts input.readlines(' ').uniq * quot;nquot; #----excerpt
  18. 18. Programming Rubies Single large, printable file 
  19. 19. Programming Rubies Contribute  Review  Enjoy  github.com/grosser/programming_pearls 

×