Updates from Sasha O RSS Toggle Comment Threads | Keyboard Shortcuts

  • Sasha O 12:53 pm on 2012-01-29 Permalink | Reply
    Tags: , templates, variable substitution,   

    Bristle template: when you don’t have time to do your Moustache 

    Usually I generate my pages with Velocity. Recently I had a project where even implementing Velocity was not worth the time. I tried both MessageFormatter and StringTemplates and both had problems with some portion of HTML/Javascript markup.

    So I did what we, engineers always do in this situation: run your own. Good news, it took just over an hour and I ended with a single very small file. It  can only variable substitution but that was enough for me. Here it is:

    http://codebistro.googlecode.com/svn/trunk/misc/src/main/java/org/codebistro/util/BristleTemplate.java

    The best part: it has no dependencies so you can just copy file into your project and template away.

    Of course you can Maven just as well:

        <repositories>
            ...
            <repository>
                <id>codebistro-open</id>
                <name>codebistro-open repo</name>
                <layout>default</layout>
                <url>http://codebistro.googlecode.com/svn/repo/</url&gt;
            </repository>
            ...
        </repositories>
        ...
        <dependencies>
            ...
            <dependency>
                <groupId>org.codebistro.util</groupId>
                <artifactId>misc</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>
         <dependencies>

    Microframeworks are popular these days. This thing doesn’t even qualify to be called micro- or even nano- but I got a feeling I am going to use Bristle template in the future…

     
  • Sasha O 1:50 am on 2011-07-09 Permalink | Reply  

    Google+: “Oops, you need a google profile to use this feature” and a workaround 

    Update: This is no longer relevant. Google+ allows to log in with a Google Apps account.

    I use my custom domain name Google Apps account as my primary email. I still have Google account and Google profile but I am not logged into this account by default.

    So when I go to http://google.com/+ I get this dreaded error message:

    Oops, you need a google profile to use this feature

    Oops, you need a google profile to use this feature

    I found a workaround to this problem. The solution requires that a) you have a “regular” Google Account (…@gmail.com) and b) this account should be enabled the “Sign in to multiple Google Accounts” feature (thanks Paul for the tip) :

    1. Go to any profile page on Google plus:

    Go to your Google Profile

    2. Click on the Account -> Switch Accounts menu:

    Switch accounts menu

    3. Select the Google Account (not the Google Apps account) or log into your Google Account:

    Switch to Google Account

    Bingo! Your Google plus is now working!

     
    • matt 10:08 pm on 2011-07-10 Permalink | Reply

      Thats a simple yet elegant tip. Thanks. :)

    • Paul 2:21 am on 2011-07-11 Permalink | Reply

      Good tip – note that you will need ‘Sign in to multiple Google Accounts’ enabled before you can see the ‘Switch Account’ link. You will find the switch on your google account page.

      • Sasha O 3:35 am on 2011-07-11 Permalink | Reply

        Thanks Paul, I have updated the post with the reference

    • Donna 7:30 pm on 2011-07-12 Permalink | Reply

      Did they block this workaround? or is this also subject to throttling? As it doesn’t work for me atm..

      I am signed into my Gmail and my Google Apps email and I see the posts on the person’s profile (as I did before) but still with no comment/+1/follow buttons on the page.

      • Sasha O 12:13 am on 2011-07-13 Permalink | Reply

        Just checked — works as it was. Guess you need to “Switch account” to your Gmail one. Just logging in won’t cut it

    • Jake 2:02 am on 2011-07-26 Permalink | Reply

      This is no longer working.
      I did the following
      1) enabled multi account login on both my
      accounts
      2) logged into my apps account
      3) switched to my regular account
      still get the same message

      • Sasha O 4:09 am on 2011-07-26 Permalink | Reply

        Jake —

        Just checked it again in a fresh ‘incognito’ window on Chrome — works for me just as it did. Did you try to clean cookies?

        Thanks,
        – Sasha

    • GG 1:28 am on 2011-07-31 Permalink | Reply

      I tried this and it was a no-go. Cleaned cookies, etc. Wonder if the two step authentication I enabled is messing about somewhere in Google’s entrails. Ah well, it’ll be available officially for apps users soon (or so the word goes)

    • Arseniy 6:41 pm on 2011-08-02 Permalink | Reply

      nice
      that’s going to be popular issue

    • Andrew Vit 2:20 am on 2011-08-11 Permalink | Reply

      Unfortunately doesn’t work for me because my personal Google account wasn’t set up as @gmail.com, but rather using my own domain. That personal account and the Apps account were separate logins (with the same email address) but now they’ve been merged so I can’t log in using that identity as a “personal” user anymore. Hopefully Google fixes these login issues soon.

      • Sasha O 6:20 am on 2011-08-14 Permalink | Reply

        Andrew, I am in exactly the same situation: I have my GA and Gmail accounts linked. Did you try to login into http://gmail.com directly?

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.