Skip to content

Instantly share code, notes, and snippets.

View manuelramos's full-sized avatar

Manuel Ramos manuelramos

View GitHub Profile
while :; do clear; docker exec <CONTAINER_NAME> psql -U <USERNAME> -d <DATABASE-NAME> -c "SELECT * FROM <TABLE-NAME>;"; sleep 1; done
## Check available branches
# Make sure that the dev branch is active
# The active branch will be prefixed by an asterisks and the name will be in green color
git branch -v
## Rebase the Dev Branch
# Rebase from remote server to sync the local branch
git pull --rebase <remote> dev
# Example - Rebase from origin
@manuelramos
manuelramos / Enable_web_path_to_access_H2_console
Created August 16, 2018 13:58
Enable web path to access H2 console
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
@manuelramos
manuelramos / app-material.module.ts
Created July 16, 2018 18:40
Angular Material Module with all available components
import { NgModule } from '@angular/core';
// Form controls
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSliderModule} from '@angular/material/slider';
@manuelramos
manuelramos / maintain vim plugins with git submodules.md
Last active June 19, 2018 15:30
A simple way to maintain vim plugins with git

Initialize any uninitialized submodules:

git submodule update --init --recursive

Install plugin

git submodule add https://github.com/manasthakur/foo.git .vim/bundle/foo
git submodule add https://github.com/manasthakur/bar.git .vim/bundle/foo/bar
git commit -m "Added submodules."
run on windows system
=====================
1- open cmd as admin
2- diskpart
3- list disk
4- select disk #
5- clean
6- create partition primary
7- format fs=fat32 quick
// run this example in https://jscomplete.com/repl/
class MyButton extends React.Component {
handleClick = () => {
this.props.onClickFunction(this.props.incrementValue);
};
render () {
return (
<button onClick={this.handleClick}>
@manuelramos
manuelramos / kill_mysql_proc.sh
Created December 7, 2016 15:17
Bash Script to Kill Sleeping MySQL Processes
#!/bin/bash
mysql -u $DBUSER -p$DBPASS -e "
select
-- *
id
from information_schema.processlist
where command = 'Sleep'
and time > 1
and host ='localhost'
" | while read id;
git config --global user.name "John Doe"
git config --global user.email [email protected]
git config --global core.editor vim
# Alias
git config --global alias.co checkout
git config --global alias.b branch
git config --global alias.ci commit
git config --global alias.s status
@manuelramos
manuelramos / Oracle_Java_Installation.sh
Last active September 21, 2018 20:17
Oracle java installation
# Decompress jdk-8u101-linux-x64.tar.gz in /usr/local/java
tar xzvf jdk-8u101-linux-x64.tar.gz -C /usr/local/java
# Purge all openjdk files installed on the system
apt-get purge openjdk-\*
# Notify the system about the existence of java
update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_151/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_151/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_151/bin/javaws" 1