Skip to content

Instantly share code, notes, and snippets.

View ilopmar's full-sized avatar

Iván López ilopmar

View GitHub Profile
@rodrigoSaladoAnaya
rodrigoSaladoAnaya / BootStrap.groovy
Last active December 19, 2015 14:58
How to integrating Vert-x in Grails using a PlatformManager. (Test)
//grails-app/conf/BootStrap.groovy
import org.vertx.java.platform.PlatformLocator
class BootStrap {
def vertxPlatformManager
def init = { servletContext ->
vertxPlatformManager = PlatformLocator.factory.createPlatformManager()
URL[] classpath = [new File('./src/verticles').toURI().toURL()]
vertxPlatformManager.deployVerticle(
@rcmorano
rcmorano / mutop
Last active December 14, 2015 07:49
'mutop' uses my other script 'mu' to sort any process listed in "ps aux" by memory usage. The last, the most [memory consumer]. COPY PASTE TO DOWNLOAD: wget -O /tmp/mutop.tgz https://gist.github.com/rcmorano/5053427/download; sudo mv /tmp/$(tar zxvf /tmp/mutop.tgz -C /tmp |grep mutop) /usr/local/bin/; sudo chmod +x /usr/local/bin/mutop
#!/bin/bash
#
# Copyright (C) 2013, Roberto C. Morano <rcmova@gmail.com>
#
# This software 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 2 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
@rcmorano
rcmorano / mu
Last active December 14, 2015 07:49
'mu' is a simple script to get real memory usage (not VSZ, not RSS but PSS) of a given PID or process pattern (uses pgrep).Check these didactic URLs for a nice explanation about memory consumption [1] and cache [2]:[1] http://emilics.com/blog/article/mconsumption.html[2] http://blog.scoutapp.com/articles/2010/10/06/determining-free-memory-on-lin…
#!/bin/bash
#
# Copyright (C) 2013, Roberto C. Morano <rcmova@gmail.com>
#
# This software 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 2 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
@willryan
willryan / MyBaseGebTest.groovy
Created October 11, 2012 16:40
Geb DB test helpers
abstract class MyBaseGebTest extends GebReportingTest {
SessionFactory sessionFactory = ApplicationHolder.application.mainContext.sessionFactory
def inTransaction(closure) {
inNewSession {
TransactionRunner.getInstance().runInNewTransaction(closure)
}
}
def inNewSession(closure) {
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@rponte
rponte / mybatis-scriptrunner-sample.java
Last active August 28, 2018 09:16
MyBatis ScriptRunner Example
// http://mybatis.googlecode.com/svn/trunk/src/test/java/org/apache/ibatis/submitted/sptests/SPTest.java
Class.forName("org.hsqldb.jdbcDriver");
conn = DriverManager.getConnection("jdbc:hsqldb:mem:sptest", "sa", "");
Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/sptests/CreateDB.sql");
ScriptRunner runner = new ScriptRunner(conn);
runner.setDelimiter("]");
runner.setLogWriter(null);