Skip to content

Instantly share code, notes, and snippets.

View josdem's full-sized avatar
🤖
Moving to Google Cloud

Jose Morales josdem

🤖
Moving to Google Cloud
View GitHub Profile
//Delete unused imports
Ctrl Alt O
//Search a keyword in whole project
Ctrl Shift F
//Close a tab
Ctrl F4
//Generate code
@josdem
josdem / Power Shell
Last active February 22, 2022 15:49
//Set proxy environment
setx HTTPS_PROXY http://proxy-url:8080
setx HTTP_PROXY http://proxy-url:8080
//Delete a directory
Remove-Item ${directory} -Recurse -Force
@josdem
josdem / AWS
Last active July 19, 2017 20:28
//Listing buckets
aws s3 ls
//List a bucket content
aws s3 ls s3://{BUCKET_NAME}
//Deploy a Jar file to a bucket
aws s3 cp {JAR_FILE} s3://{BUCKET_NAME}
//Create a Lambda function using s3
@josdem
josdem / Java
Last active April 10, 2017 17:32
//Find out your Java heap memory size
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
//Uninstall openjdk Debian
sudo apt-get purge openjdk-\*
//Uninstall openJDK RedHat
sudo yum remove java*-openjdk*
//Increace Heap Memory using jar
//Print a list of all databases on the server
show dbs
//Switch or create database
use {database}
//Print a list of all collections for current database
db.getCollectionNames()
//Find all documents in the collection and returns a cursor
@josdem
josdem / javascript
Last active February 8, 2016 16:46
// Calling functions dynamically
var str = 'fisica'
var actions = {
fisica: function() {console.log('Fisica')},
moral: function() {console.log('Moral')}
}
actions[str]()
@josdem
josdem / Sublime
Last active February 7, 2017 22:02
//Column multyselection
alt shift Down
(Windows) hold down middle mouse button and drag
//Delete a row
ctrl shift k
//Find and replace in a folder
ctrl shift f
@josdem
josdem / SDK
Created December 18, 2015 01:16
//Install specific grails version
sdk install grails 3.0.9
//List grails versions
sdk list grails
//Run specific test
grails test-app -unit com.modulus.uno.UserServiceSpec
//Run all test
grails test-app
//Create controller and views from a domain class
grails generate-all com.modulus.uno.Telephone
//Create a Service
@josdem
josdem / Liquibase
Last active November 4, 2015 18:46
//Generate a new changelog
dbm-generate-changelog changelog.groovy
//Generate a changelog
dbm-gorm-diff add-telephone.groovy --add
//Update database schema
dbm-update