Skip to content

Instantly share code, notes, and snippets.

Gregory Dickson gregorydickson

Block or report user

Report or block gregorydickson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View PullmanScraperQuartzJob.groovy
import latambuses.*
import org.quartz.JobExecutionContext
import groovyx.gpars.GParsPool
import groovy.time.TimeCategory
import cl.pullman.websales.to.CiudadTO
import cl.pullman.websales.to.EmpresaTO
import cl.pullman.websales.to.ServicioTO
import cl.pullman.websales.to.TarifaTO
View GORM Criteria Query with Alias
List results = criteria.listDistinct () {
createAlias('samples','s',CriteriaSpecification.LEFT_JOIN)
createAlias('s.sampleRequests', 'sr', CriteriaSpecification.LEFT_JOIN)
or {
isNull('s.id')
sizeEq('s.sampleRequests', 0)
//Needs to be any samples available, not all samples available.
// In other words check all items in the collection and if they all meet
// the condition then exclude
View formselect.js
import {bindable, inject,bindingMode, customElement} from 'aurelia-framework';
// Import JSPM modules we installed earlier
import $ from 'jquery';
import 'select2';
@customElement('form-select') // Define the name of our custom element
@inject(Element) // Inject the instance of this element
export class CustomSelect {
@gregorydickson
gregorydickson / 05-java-7-oraclejdk.config
Created Oct 26, 2016
Elastic Beanstalk / Java deployment -- Installing Oracle Java 7 via .ebextensions in your WAR file. This file should be in the src/main/webapp/.ebextensions directory of your WAR file, and Elastic Beanstalk will deploy Oracle Java 7 during configuration of the running node. The file is prefixed with "05-" to control the execution order of these …
View 05-java-7-oraclejdk.config
commands:
00_download_jdk7:
command: wget --no-cookies --no-check-certificate --header "Cookie:gpw_e24=xxx" "http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-x64.rpm" -O /etc/tomcat7/jdk7-oracle.rpm
test: test ! -f /etc/tomcat7/oracle-jdk7-installed.txt
01_install_oracle_jdk7:
command: yum -y install jdk7-oracle.rpm
cwd: /etc/tomcat7
test: test ! -f /etc/tomcat7/oracle-jdk7-installed.txt
@gregorydickson
gregorydickson / SmallNettyServer.groovy
Created May 18, 2016 — forked from itzg/SmallNettyServer.groovy
Just enough Groovy code to implement a GET'able HTTP server with regex based path routing.
View SmallNettyServer.groovy
import org.jboss.netty.bootstrap.ServerBootstrap
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.channel.ChannelHandlerContext
import org.jboss.netty.channel.ChannelPipeline
import org.jboss.netty.channel.ChannelPipelineFactory
import org.jboss.netty.channel.Channels
import org.jboss.netty.channel.MessageEvent
import org.jboss.netty.channel.SimpleChannelUpstreamHandler
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory
import org.jboss.netty.handler.codec.http.DefaultHttpResponse
View How to install Cassandra on Ubuntu?.markdown

0. Overview

This article aims to be a portal to installation and configuration of Cassandra. It is self-contained in the first place. It also provides links to the original articles.

Warning: This article is still under written.

Prerequisites

Install Oracle Java Development Kit (JDK)

View flatten.groovy
import java.util.ArrayList
def flatten
flatten = { list ->
switch(list){
case list.size() == 0:
return
break
case {list.head() instanceof Integer && list.size() == 1}:
result = list
You can’t perform that action at this time.