Skip to content

Instantly share code, notes, and snippets.

View xmlking's full-sized avatar
🌝
Write code that will last longer than You

Sumanth Chinthagunta xmlking

🌝
Write code that will last longer than You
View GitHub Profile
@xmlking
xmlking / BarService.groovy
Last active August 29, 2015 13:56
Resilience Framework
import grails.transaction.Transactional
@Transactional(readOnly = true)
class BarService implements Greet{
static scope = "prototype"
@Override
public String greet() throws IOException{
if (new Random().nextInt(2) == 1) throw new IOException("dummy exception from BarService in...greet");
@xmlking
xmlking / bower.json
Last active August 29, 2015 14:00
Angular Gulp workflow with SASS and Traceur for ES6 -> ES5
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"main": "app/index.html",
"dependencies": {
"jquery": "jquery/jquery",
"angular": "1.3.0-beta.5",
"es6-shim": ">=0.8.0",
"bootstrap-sass-official": "~3.1.1",
@xmlking
xmlking / test.html
Last active August 29, 2015 14:26
Demonstrate streaming JSON data parsing with OboeJS lib. Client consuming streaming REST endpoint implemented using NodeJS/RxJava/Ratpack etc and -chunked transfer- encoding
<html>
<head>
<title>OboeJS demo</title>
<script src="https://rawgit.com/jimhigson/oboe.js/v2.1.2/dist/oboe-browser.min.js"></script>
</head>
<body>
<div ></div>
<ul id="content">
<li>AUD_CAD:</li>
</ul>
@xmlking
xmlking / info.md
Created September 4, 2015 23:59
installing angular-new-router with JSPM without pulling unnecessary dependencies

How to install angular-new-router with JSPM without pulling unnecessary dependencies into jspm.config.js:

 jspm install npm:angular-new-router -o '{"main": "dist/router.es5", "format": "es6",  "dependencies": {"jspm:angular": "^1.4.5"}, "shim": { "dist/router.es5": {"deps": ["angular"]} } }'

Change Angular version if you are different version. with shim it also makesure angular is loaded before angular-new-router

@xmlking
xmlking / README.md
Last active September 21, 2015 21:50
Amazon Dash Button triggering Auth0's `webtask` to send text message when button is pressed.

Node-Dash-Button-Webtasks

Simple demo showcasing IoT and Auto0's Webtask integration.

npm install wt-cli -g

wt create send_text.js --name send_text -s TWILIO_ACCOUNT_SID=aaaa -s TWILIO_AUTH_TOKEN=aaa -s TWILIO_NUMBER=+15005550006
@xmlking
xmlking / test123
Created August 5, 2011 20:06
test
test 123456
@xmlking
xmlking / gist:1131066
Created August 8, 2011 01:46
Page Rendering API to send email with template
grails.gsp.PageRenderer groovyPageRenderer
void welcomeUser(User user) {
def contents = groovyPageRenderer.render(view:"/emails/welcomeLetter", model:[user: user])
sendEmail {
to user.email
body contents
}
----------------
@xmlking
xmlking / gist:1131291
Created August 8, 2011 06:18
It spring-security-core 1.2 depends of svn grails plugin?
Is spring-security-core depends of svn grails plugin?
burtbeckwith: Sorry about that, there are some issues with releasing plugins and using them in 2.0. I used the release plugin, which depends on the svn plugin, and unfortunately the svn plugin ended up in the pom file. This only affects Grails 2.0 apps since earlier versions don't use the poms.
@xmlking
xmlking / gist:1132797
Created August 8, 2011 21:26
Placeholder in html5
<form>
<code>
<input name="fieldname" placeholder="Enter any keyword">
<input type="submit" value="Search">
</code>
</form>
@xmlking
xmlking / gist:1163625
Created August 22, 2011 21:20
jQuery's AJAX polling
$.ajax({
url : "chatlog",
success : function(message) {
if (message && message.length) {
var messagesDiv = $('#messages');
messagesDiv.html(message);
messagesDiv.animate({ scrollTop: messagesDiv.attr("scrollHeight") - messagesDiv.height() }, 150);
}
timer = poll();
},