Skip to content

Instantly share code, notes, and snippets.

View pydawan's full-sized avatar

Thiago Monteiro pydawan

View GitHub Profile
@erkobridee
erkobridee / maven-util-cmds.md
Created August 7, 2012 18:10
comandos úteis para uso do maven

#Comandos úteis do Maven

Criação de Projeto

desktop java (jar)

mvn archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \
 -DarchetypeArtifactId=maven-archetype-quickstart \
@AvnerCohen
AvnerCohen / npm-cheat-sheet.md
Last active August 28, 2025 08:29
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

List of less common (however useful) NPM commands

Prepand ./bin to your $PATH

Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@osmanizbat
osmanizbat / GroovierReport.groovy
Last active September 27, 2019 13:39
Groovier reports with groovy & jasperreports
import java.awt.Color;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.*;
import net.sf.jasperreports.engine.type.*;
import net.sf.jasperreports.view.JasperViewer
class GroovierReport {
static void main(String[] args) {
def builder = new ObjectGraphBuilder()
@jednano
jednano / gitcom.md
Last active July 31, 2025 00:04
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@msakamoto-sf
msakamoto-sf / start_jetty.groovy
Last active January 5, 2021 19:54
Jetty + GroovyServlet + Groovy Script = Start Jetty Anywhere !! You only need Groovy :)
@Grapes([
@Grab('org.eclipse.jetty.aggregate:jetty-all:8.1.10.v20130312'),
@Grab('com.h2database:h2:1.3.171'),
@Grab('javax.servlet:servlet-api:2.5'),
])
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import org.eclipse.jetty.webapp.*
import javax.servlet.*
import javax.servlet.http.*
@raineorshine
raineorshine / java-exception-handling-best-practices.md
Last active May 19, 2024 10:57
5 Great Resources for Exception Handling Best Practices in Java

General Tip

"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."

Resources

Advantages of Exceptions
Excellent example of separating error-handling code from program logic

Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.

@taichi
taichi / postgre.gradle
Created August 7, 2013 10:12
enable PostgreSQL configuration to Wildfly using Gradle.
dependencies { runtime 'org.postgresql:postgresql:9.2-1003-jdbc4' }
task installPostgreSQL(type: Copy) {
def postgreJar = configurations.runtime.find { it.name.contains('postgresql') }
def moduleDir = "$jbossHome/modules/system/layers/base/org/postgresql/main"
from postgreJar
into moduleDir
doLast {
@vinaydotblog
vinaydotblog / composer-install.sh
Last active April 17, 2023 11:08
Installing composer using curl
# Goto a directory you can write to:
cd ~
#get composer:
curl -s https://getcomposer.org/installer | php
# move composer into a bin directory you control:
sudo mv composer.phar /usr/local/bin/composer
# double check composer works
composer about
@itzg
itzg / SmallNettyServer.groovy
Created October 21, 2013 20:07
Just enough Groovy code to implement a GET'able HTTP server with regex based path routing.
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
@joyrexus
joyrexus / README.md
Last active September 6, 2025 15:46 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})