Skip to content

Instantly share code, notes, and snippets.

View ilmoralito's full-sized avatar

Mario Martinez ilmoralito

View GitHub Profile
@graemerocher
graemerocher / migrate-jira-to-github-issues.groovy
Last active November 19, 2024 15:23
JIRA to Github Issues Migration Script
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
@Grab(group='joda-time', module='joda-time', version='2.7')
import wslite.rest.*
import org.joda.time.*
import org.joda.time.format.*
import groovy.xml.*
import groovy.json.*
import static java.lang.System.*
import groovy.transform.*
@kdabir
kdabir / inline.groovy
Created September 27, 2014 17:53
Groovy List Destructuring
def (a,b,rest) = [0, 1, 2..-1].collect { [1,2,3,4][it] }
assert a == 1
assert b == 2
assert rest == [3,4]
@hieblmedia
hieblmedia / .gitignore
Last active April 12, 2025 02:48
Gitignore - Exclude all except specific subdirectory
#
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
#
/**
!/.gitignore
###############################
# Un-ignore the affected subdirectory
@pid
pid / keystroke-toggle-linenumbers-settings.json
Created October 21, 2013 20:17
Sublime Text keystroke toggle line numbers show/hide
{
"keys": ["ctrl+alt+l"],
"command": "toggle_setting",
"args": {
"setting": "line_numbers"
}
@rothgar
rothgar / GNOMEShell.textile
Last active August 22, 2024 17:21
GNOME 3 keyboard shortcuts

Keyboard Shortcuts – GNOME Shell 3.8+

General Navigation

Super or Alt + F1 or Super + S Activities Overview
Alt + F2 Command window
Super + A Application View
Super + M Toggle Message Tray
Super + N Focus Notification
Ctrl + Alt + Tab Toggle System Focus (Windows, Top Bar, Messages)
@noromanba
noromanba / toDateTimeTZInfoString.js
Last active August 1, 2020 03:13
format current local date to "yyyy-MM-dd HH:mm:ss TZ-info" on X-browser
// X-browser print local datetime w/ yyyy-MM-dd HH:mm:ss TZInfo format
// e.g. 2014-11-20 03:16:26 GMT+0900 (JST)
// @author noromanba http://flavors.me/noromanba
// @license CC0 Univ PD http://creativecommons.org/publicdomain/zero/1.0
// c.f.
// https://gist.github.com/noromanba/6736822
// http://let.hatelabo.jp/noromanba/let/hJmcrJfO94ka/rev/hJmcruLM2p0H
// http://let.hatelabo.jp/noromanba/let/hJmcrJfO94ka
var toDateTimeTZInfoString = (function () {
@reaneyk
reaneyk / gist:6604607
Created September 18, 2013 04:39
Example PHP Interface class
<?php
//Define a new Interface for all 'shapes' to inherit
interface Shape {
//Define the methods required for classes to implement
public function getColor();
public function setColor($color);
@wumpz
wumpz / gist:5846559
Created June 23, 2013 21:12
list authors of a git repository including commit count and email
git shortlog -e -s -n
@bickart
bickart / repair.php
Created April 26, 2013 15:29
How to perform a SugarCRM Quick Repair and Rebuild from the line
#!/usr/bin/php
<?php
/*
* Copyright 2013
* Jeff Bickart
* @bickart
* jeff @ neposystems.com
*/
@ddelponte
ddelponte / controllerAndServiceValidationHandling.groovy
Created December 5, 2012 16:14
Grails Service: Validation Errors and Rollback
Validation Errors and Rollback
A common use case is to rollback a transaction if there are validation errors. For example consider this service:
import grails.validation.ValidationException
class AuthorService {
void updateAge(id, int age) {
def author = Author.get(id)
author.age = age
if (!author.validate()) {