Demo Site

Thursday, March 08, 2012

Ajax requests in Chrome when loading local files

This always annoyed me trying to find, so here it is, if you're trying to load up an html page with some javascript that needs to make ajax requests, but you're doing it without running a webserver, then Chrome will block those requests unless you start Chrome with these startup flags:

--args --allow-file-access-from-files --disable-web-security
On Ubuntu this then looks like:


$ /opt/google/chrome/google-chrome --args --allow-file-access-from-files --disable-web-security
Then you look at page like:

file:///home/Documents/Workspaces/workspace-sts-2.7.0.RELEASE/myapp/src/test/webapp-test/scripts/panels/gwindow-test.html

and ajax requests will work-


Monday, December 12, 2011

Ooops! Someone deployed google search with the wrong css...

Hover over a google search result in chrome and you see this:


Notice the edges of the red and blue google plus icon. Appears even Google's testing isn't perfect-

Monday, June 20, 2011

Chrome developer tools - copy command

This apparently hasn't made it into the official documentation for the chrome dev tools, so here it is to not forget, to get the contents of a variable out of the console and onto your clipboard for pasting pleasure, use the copy(yourvariable) command :)

rest of the reference - http://code.google.com/chrome/devtools/docs/console.html

Thursday, January 06, 2011

Running Eurekastreams on windows with eclipse

  1. install egit, m2eclipse
  2. clone git repo using egit import wizard - use the url on the git site (https://github.com/lmco/eurekastreams.git) and make the clone location be in your current workspace
  3. modify the poms for windows before using  the m2eclipse/maven project wizard - saves an extra step rebuilding the app again
  4. modifications necessary for windows:
    1. comment out the maven-checkstyle-plugin in the parent pom
    2. comment out the exec-maven-plugin with the chmodder execution in parent.pom and web module.
    3. comment out the two sections refercing the lib-java folder in web module pom
    4. add build.web.host value to your maven build 
  5. import as existing maven project (with the git repo as the target directory), and make sure every module is being managed by maven 
  6. make sure you have postgres 8.4 installed, if not, get the installer here - http://www.enterprisedb.com/products/pgdownload.do#windows
  7. create a db called eurekastreams, a user called eurekastreams, and make the password whatever you want, but place the password in the eurekastreams-server.properties file under eurekastreams.db.password 
  8. run this batch file (switching in your own file paths as appropriate) on the db scripts in the generated build folder (from  rocketman -https://groups.google.com/forum/?lnk=gst&q=gwt&pli=1#!searchin/eureka-streams-dev/windows/eureka-streams-dev/jjxcGb0b66o/FXr3dDO8tt4J
    1. REM @echo off 
      setlocal 

      set PGPASSWORD=yourpassword (eg eurekastreams)
      set ES_HOME=C:\workspaces\workspace.35sr1\eurekastreams 
      cd %ES_HOME%\web\target\classes\db\schema 
      for /r . %%i in ("*.sql") do psql -U eurekastreams -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\0\8 
      for /r . %%i in ("*.sql") do psql -U eurekastreams  -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\0\9 
      for /r . %%i in ("*.sql") do psql -U eurekastreams -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\1\0 
      for /r . %%i in ("*.sql") do psql -U eurekastreams  -f %%i 

      endlocal 
    2. setting the pgpassword as an environmental variable is a bit insecure, but I don't think this will both most people setting up es for testing.
  9. run the app with jetty, and use one of the default browsers already in the ApplidationDev.gwt.xml file, or add/change it to include gwt compilation for your browser (aka chrome :)
  10. and hopefully....eureka

Saturday, November 27, 2010

multi line search and replace in eclipse (and across multiple files)

This is surprisingly more difficult that it should be. Search and replace across multiple files is covered very well here:

http://www.avajava.com/tutorials/lessons/how-do-i-do-a-find-and-replace-in-multiple-files-in-eclipse.html?page=2


but searching for things that span more than one line, wasn't covered almost anywhere, so here goes.

1. multi line search can only be accomplished by regex in eclipse (I'm using helios), so searching for something like -

 replace me
 replace me 2

would require an expressions like 'word1[\s\S]*word2' or 'word1[\s\S]*?word2' for a non-greedy expression.


to get the text back in, you'll need to also put it in one line, so a site like this can come in handy:


http://kangax.github.com/html-minifier/

Wednesday, May 12, 2010

Ibatis, Oracle and SelectKey

Another useless waste of 30 minutes, apparently if you're having problems getting Ibatis's selectkey statement to work, in order to get (and return) a generated key, it will fail with something like

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
--- The error occurred while applying a parameter map.
--- Check the insertEntity-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into
("ODS"."ENTITY_SRC"."ENT_SRC_ID")

the answer? explicitly add the type attribute and set it to "pre". ugh-

Thursday, April 15, 2010

Google 2010 redesign

The site design is pleasing, the new logo is just too much. Compare them below


2009


2010

The colors are just a little too gaudy, the yellow "o" almost looks golden, now you see search results, its almost like seeing a stretch of golden rings. yuck.

Here's a way to bring back a more pleasing logo-
https://chrome.google.com/extensions/detail/nedjejdfkkjgebciefdfofjhmeogiaga

Labels

Labels

Labels