Skip to content

Instantly share code, notes, and snippets.

View jxc876's full-sized avatar
:octocat:

Michael Ramirez jxc876

:octocat:
  • Texas, United States
  • 22:49 (UTC -05:00)
View GitHub Profile
@jxc876
jxc876 / gist:7a4de0023f8fa63fdf2e
Created February 11, 2015 17:19
Grails cheatsheet
// Run the BootStrap.groovy script within the Grails Console
// http://derekmarley.com/2010/10/27/grails-bootstrap-within-the-grails-console/
new BootStrap().init(ctx.servletContext)
// Create toString method
// http://groovy.codehaus.org/gapi/groovy/transform/ToString.html
@ToString // Annotate class
foo.toString() // usage
@jxc876
jxc876 / gist:9728dae3065a102cca0e
Last active August 29, 2015 14:13
Groovy Regex
// String, need to escape backslashes
def bs = '\\\\'
// Slashy Strings: /abc/
// String literal not needing additional backslashes to escape special characters.
def path = /C:\dev\source/
// G-Strings (double-quotes)
@jxc876
jxc876 / jsfiddle-logging
Last active August 29, 2015 14:13
Log on
/*
REQUIREMENTS:
---------
1) JQuery is required
2) Create a element with the id of "console-log"
EX: <div id="console-log"></div>
USAGE:
---------
console.log('hello');
@jxc876
jxc876 / Engine.java
Last active August 29, 2015 14:10 — forked from schup/Engine.java
// Engine.java
public interface Engine {
void start();
void stop();
}
public class Volatility {
static int NEXT_IN_LINE = 0;
public static void main(String[] args) throws Exception {
new CustomerInLine().start();
new Queue().start();
}
static class CustomerInLine extends Thread {