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 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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="/jquery.min.js"></script> | |
<title>Mime type checker</title> | |
<script> | |
$(function () { | |
var result = $('div#result'); | |
if (window.FileReader && window.Blob) { | |
$('span#submit').click(function () { | |
var files = $('input#file').get(0).files; |
This file contains 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 focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This file contains 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 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()) { |
This file contains 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
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |