Skip to content

Instantly share code, notes, and snippets.

View danvega's full-sized avatar
:octocat:
Grinding

Dan Vega danvega

:octocat:
Grinding
View GitHub Profile
<cfscript>
this.ormEnabled = true;
this.datasource = "YOUR_DATASOURCE_HERE";
this.ormSettings = {
dbcreate = "update",
eventhandling = true,
flushAtRequestEnd = false,
cfclocation = []
};
</cfscript>
@danvega
danvega / webtail.js
Created April 24, 2012 02:37
NodeJs Tail to browser window
var http = require('http');
var spawn = require('child_process').spawn;
http.createServer(function(request,response){
response.writeHead(200,{
'Content-Type' : 'text/plain'
});
var directory = 'C:\\ColdFusion9\\logs\\';
<!DOCTYPE HTML>
<html>
<head>
<title>Building a data object from rows</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function(){
var rows = $(".row");
<!---
Slatwall - An Open Source eCommerce Platform
Copyright (C) 2011 ten24, LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@danvega
danvega / gist:5770121
Created June 12, 2013 23:46
Bootstrap row slider
<!DOCTYPE HTML>
<html>
<head>
<title>Bootstrap</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<style>
body {background: #eee}
.container {background: #fff;}
a.sliderImage {margin: 0 25px 0 25px;text-align: center;display: block;}
a.pname {margin: 25px;text-align: center;display: block;}
@danvega
danvega / gist:9001764
Created February 14, 2014 14:20
Return multiple values in Groovy
String username = 'dvega'
String password = 'password'
String auth = "$username:$password"
def (user,pass) = auth.split(':')
println "user=$user pass=$pass"
@danvega
danvega / gist:9808383
Last active August 29, 2015 13:57
Grails Service Transaction Support Methods (Burt Beckwith Grails Book)
import org.springframework.transaction.interceptor.TransactionAspectSupport
import org.springframework.transaction.support.TransactionSynchronizationManager
class BootStrap {
def grailsApplication
def init = { servletContext ->
// transaction support for services
@danvega
danvega / gist:9847143
Created March 29, 2014 02:19
Grails - Logging Sql in development with format + comments on
dataSource {
pooled = true
jmxExport = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
@danvega
danvega / gist:9877792
Created March 30, 2014 18:58
Grails Layout setting active class for current "page" (controller + action)
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="${controllerName == null ? 'active' : ''}">
<a href="${createLink(uri:'/')}">Home</a>
</li>
<li class="${controllerName == 'blog' ? 'active' : ''}">
<a href="${createLink(uri: '/blog')}">Blog</a>
</li>
@danvega
danvega / gist:9912759
Created April 1, 2014 12:14
Blog Post Sample
<div class="entry">
<p>I am working on coverting this site over to a grails applicaiton. While there are some good plugins out there I could of taken advantage of I decided to use this as a learning experience and write a ton of it from scratch. </p>
<p>For the blog post itself we have some unique URLs that look like this
</p><blockquote>/blog/2014/3/30/Grails-views-Controller-and-Action-name</blockquote>
This converts to /blog/year/month/day/slug. So first thing I needed to was setup a url mapping for this path. I also put some constraints on the parameters so we get exactly what we are looking for.