Skip to content

Instantly share code, notes, and snippets.

@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / 00. tutorial.md
Created June 20, 2016 21:12 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / excel.groovy
Created May 19, 2016 10:46 — forked from timyates/excel.groovy
Create a styled Excel spreadsheet with Groovy and Apache POI
@Grab( 'org.apache.poi:poi:3.9' )
import static org.apache.poi.ss.usermodel.CellStyle.*
import static org.apache.poi.ss.usermodel.IndexedColors.*
import org.apache.poi.hssf.usermodel.HSSFWorkbook
new HSSFWorkbook().with { workbook ->
def styles = [ LIGHT_BLUE, LIGHT_GREEN, LIGHT_ORANGE ].collect { color ->
createCellStyle().with { style ->
fillForegroundColor = color.index
fillPattern = SOLID_FOREGROUND
package org.eiji
@Grapes([
@Grab(group='org.slf4j', module='slf4j-log4j12', version='1.6.6'),
@Grab(group='ch.qos.logback', module='logback-classic', version='0.9.28')
]
)
import org.slf4j.Logger
import org.slf4j.LoggerFactory
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
recipes:
global:
- dotfiles::gitconfig
- applications::sass
- applications::ssh_config
- dotfiles::vim
- applications::composer
- applications::postgresql
- applications::mysql
- applications::php55
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / GmailHelper.java
Created January 27, 2016 12:37 — forked from nutanc/GmailHelper.java
Helper class for Gmail API to send and receive mails
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / gstorm_getter.groovy
Created January 27, 2016 10:46 — forked from kdabir/gstorm_getter.groovy
example of effect of getter in gstorm
@GrabResolver(name='gstorm', root='http://dl.bintray.com/kdabir/maven')
@Grab('io.github.kdabir.gstorm:gstorm:0.7')
@GrabConfig(systemClassLoader = true)
@Grab('org.hsqldb:hsqldb:2.3.2')
import groovy.sql.*
import gstorm.*
// using sql object explicitly to create Gstorm instance, this can be any other jdbc driver
def sql = Sql.newInstance("jdbc:hsqldb:mem:database1", "sa", "", "org.hsqldb.jdbcDriver")
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Default (OSX).sublime-keymap
Created January 18, 2016 11:45 — forked from atuttle/Default (OSX).sublime-keymap
My Sublime Text 3 Preferences and Keymaps
[
{ "keys": ["alt+up"], "command": "swap_line_up" }
,{ "keys": ["alt+down"], "command": "swap_line_down" }
,{ "keys": ["ctrl+alt+down"], "command": "duplicate_line" }
,{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }
,{
"keys": ["ctrl+alt+left"],
"command": "set_layout",
"args": {
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / timezones.cfm
Created January 18, 2016 11:41 — forked from atuttle/timezones.cfm
Dealing with Time Zones in ColdFusion
<!---
Many thanks to Sean Corfield and Ryan Guill who set me down the correct path of java.util.TimeZone
--->
<cfscript>
writeDump(label="Conversion Examples",var={
"0-local-tz": getSystemTZ()
,"1-local-now": now()
,"2-utc-now": toUTC(now())
,"3-eastern-now": TZtoTZ( getSystemTZ(), now(), "America/New_York" )
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / jetty.groovy
Created January 18, 2016 10:17 — forked from akhikhl/jetty.groovy
groovy script for starting jetty server against the specified folder
@Grab('javax.servlet:javax.servlet-api:3.0.1')
@Grab(group='org.eclipse.jetty', module='jetty-webapp', version='8.1.8.v20121106')
@Grab(group='org.eclipse.jetty', module='jetty-server', version='8.1.8.v20121106', transitive=false)
@Grab(group='org.eclipse.jetty', module='jetty-servlet', version='8.1.8.v20121106', transitive=false)
@GrabExclude('org.eclipse.jetty.orbit:javax.servlet')
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*