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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def (a,b,rest) = [0, 1, 2..-1].collect { [1,2,3,4][it] } | |
assert a == 1 | |
assert b == 2 | |
assert rest == [3,4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# If all files excluded and you will include only specific sub-directories | |
# the parent path must matched before. | |
# | |
/** | |
!/.gitignore | |
############################### | |
# Un-ignore the affected subdirectory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keys": ["ctrl+alt+l"], | |
"command": "toggle_setting", | |
"args": { | |
"setting": "line_numbers" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git shortlog -e -s -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/* | |
* Copyright 2013 | |
* Jeff Bickart | |
* @bickart | |
* jeff @ neposystems.com | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) { |