Skip to content

Instantly share code, notes, and snippets.

View oviniciusfeitosa's full-sized avatar
🧛

Vinícius Feitosa da Silva oviniciusfeitosa

🧛
View GitHub Profile
@oviniciusfeitosa
oviniciusfeitosa / PHPStorm_Improve_performance.pibb
Created August 19, 2016 17:17
PHPStorm Improve your performance
http://stackoverflow.com/documentation/phpstorm/4595/phpstorm-optimization/16133/speed-increase-using-opengl#t=201607311337189808792
@oviniciusfeitosa
oviniciusfeitosa / Disable_gnome_alt_left_button
Created August 19, 2016 17:59
Disable gnome alt left button
First of all, install dconf-tools Install dconf-tools.
To do that, run the following command:
sudo apt-get install dconf-tools
Then open it, Alt+F2 → dconf-editor.
Scroll down to org → gnome → desktop → wm → preferences → mouse-button-modifier → Set it to whichever key you like.
Source : http://askubuntu.com/questions/118151/how-do-i-disable-window-move-with-alt-left-mouse-button-in-gnome-shell
@oviniciusfeitosa
oviniciusfeitosa / gist:179db6e9d521a10689ad7e2f1c952ee6
Created August 29, 2016 02:21
Exec Bash on started docker container
docker exec -ti {container_id} bash
@oviniciusfeitosa
oviniciusfeitosa / disable.sh
Created August 30, 2016 18:09
Turn network to public and disable firewall on linux
sudo ufw disable
# network ip need to be "0.0.0.0"
@oviniciusfeitosa
oviniciusfeitosa / Readme.pibb
Last active August 30, 2016 18:16
JBOSS - Share network access to anyone
Change the file "standalone.xml":
<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
to
<interface name="public">
<any-ipv4-address/>
@oviniciusfeitosa
oviniciusfeitosa / pom.xml
Created September 13, 2016 17:49
[ JAVA ] Google Oauth2 - java.lang.NoClassDefFoundError
When occurs this error below, use the next steps:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/appengine/api/urlfetch/HTTPMethod
at com.google.api.client.extensions.appengine.http.UrlFetchTransport.buildRequest(UrlFetchTransport.java:125)
You need to replace this dependency:
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-servlet</artifactId>
@oviniciusfeitosa
oviniciusfeitosa / UndoCommitAndRedo.bash
Created September 13, 2016 17:51
[ Git ] Undo a commit and redo
Undo a commit and redo
$ git commit -m "Something terribly misguided" (1)
$ git reset HEAD~ (2)
<< edit files as necessary >> (3)
$ git add ... (4)
$ git commit -c ORIG_HEAD (5)
Source : http://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git
@oviniciusfeitosa
oviniciusfeitosa / exporCommittedFiles.bash
Created September 13, 2016 18:04
[ GIT ] Export committed files to tar file
Just replace the code below, changing "{COMMIT_ID}" for your commit ID, like "8281a97f653d36da3dc5ed958bbfc87827e2d1d9", for example
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT {COMMIT_ID} | xargs tar -rf mytarfile.tar
@oviniciusfeitosa
oviniciusfeitosa / Readme.md
Last active September 20, 2016 19:38
Fix docker debian image locale error !

Just run the commands below and have fun!

$ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
$ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen &&     echo 'LANG="en_US.UTF-8"'>/etc/default/locale &&     dpkg-reconfigure --frontend=noninteractive locales &&     update-locale LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8

More details here: http://stackoverflow.com/questions/28405902/how-to-set-the-locale-inside-a-docker-container

@oviniciusfeitosa
oviniciusfeitosa / Readme.md
Created September 21, 2016 19:01
[ Java - Lambda Expressions ] Apply filters on Lists
Example 1:
List<Person> beerDrinkers = persons.stream().filter(p -> p.getAge() > 16).collect(Collectors.toList());
Example 2:
persons.removeIf(p -> p.getAge() > 16);

Where lambda expressions are assumed by Predicate class.