Skip to content

Instantly share code, notes, and snippets.

@ondrej-kvasnovsky
ondrej-kvasnovsky / welcomePage.html
Last active December 18, 2015 01:08
Code samples showing how to add Twitter button into a Meteor application
<template name='welcomePage'>
<a href="https://twitter.com/intent/tweet?screen_name=TemplHub"
class="twitter-mention-button"
data-related="TemplHub">
Tweet to @TemplHub
</a>
</template>
@ondrej-kvasnovsky
ondrej-kvasnovsky / AppWidgetSet.gwt.xml
Last active December 18, 2015 00:59
ANT script for the widget set compilation.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.example.YourWidgetset" />
</module>
@ondrej-kvasnovsky
ondrej-kvasnovsky / googleAnalytics-new.js
Last active April 2, 2017 19:19
Meteor with Google Analytics
Template.googleAnalytics.rendered = function() {
new GA('UA-111-1', 'my-account-name');
}
GA = function(code, account) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
@ondrej-kvasnovsky
ondrej-kvasnovsky / gist:2140982
Created March 20, 2012 20:30
grails-vaadin example - user service
class UserService {
static transactional = true
void update(User user) {
// TODO: ... implement the logic ...
user.save(flush:true, failOnError:true)
}
}