This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.berry | |
| import com.berry.BCrypt | |
| import grails.converters.JSON | |
| class CaptchaController { | |
| def index = { | |
| // Generate the SALT to be used for encryption and place in session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "text":"heart", | |
| "images":[ | |
| { | |
| "hash":"$2a$10$GTcG7U1rt7XFBi4JVImT2Oo.E3D8FCzha2772XuXm7v28Kx2LNL5S", | |
| "file":"images/captchaImages/99.png" | |
| }, | |
| { | |
| "hash":"$2a$10$GTcG7U1rt7XFBi4JVImT2Oa5Y/I/cXOUj30kffPqyX0qxTnAACX6O", | |
| "file":"images/captchaImages/43.png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- PLACE IN HEADER --> | |
| <script type="text/javascript" src="${resource(dir:'js',file:'jquery.simpleCaptcha-0.2.js')}"></script> | |
| <style type="text/css"> | |
| img.simpleCaptcha { | |
| margin: 2px !important; | |
| cursor: pointer; | |
| } | |
| img.simpleCaptchaSelected { | |
| margin-bottom: 0px; | |
| border-bottom: 2px solid red; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| // The number of spaces a tab is considered equal to | |
| "tab_size": 2, | |
| // Set to true to insert spaces when tab is pressed | |
| "translate_tabs_to_spaces": true, | |
| "font_face": "Droid Sans Mono", | |
| "font_size": 15, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ctx = null | |
| $(document).ready -> | |
| # get a reference to the canvas | |
| ctx = $('#canvas')[0].getContext("2d") | |
| # draw a circle | |
| ctx.beginPath() | |
| ctx.arc(75, 75, 10, 0, Math.PI*2, true) | |
| ctx.closePath() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Breakout</title> | |
| <meta charset="utf-8" /> | |
| <script type="text/javascript" | |
| src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
| <script type="text/javascript" src="breakout.js"></script> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ApplicationHelper | |
| # Helper method to wrap an input field for twitter bootstrap | |
| # @param [Object] model_instance Instanciated model | |
| # @param [Symbol] field_name Attribute name of the field being referred to in this block | |
| # @param [Hash] options Set of options. See example. | |
| # | |
| # @example | |
| # <!-- | |
| # Available options: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ====== [UTILS] ====== | |
| //function for generating "random" id of objects in DB | |
| function S4() { | |
| return (((1+Math.random())*0x10000)|0).toString(16).substring(1); | |
| } | |
| function guid() { | |
| return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ab:splitTest name="My First Split Test"> | |
| This is my default content that appears when the test is disabled. | |
| </ab:splitTest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExampleController { | |
| def splitTestService | |
| def converted() { | |
| // Mark split test with name 'My First Split Test' as converted | |
| splitTestService.markTestAsConverted('My First Split Test') | |
| } | |
| } |