Skip to content

Instantly share code, notes, and snippets.

View leonardocregis's full-sized avatar

Leonardo leonardocregis

  • Rio de Janeiro
View GitHub Profile
#listing locally
npm ls
#listing globally, only the first level
npm ls -g --depth=0
@leonardocregis
leonardocregis / javascript - angularjs - focus
Last active September 15, 2017 12:46
sample of managing a focus
<html>
<body>
<div ng-app="app" ng-controller="controll">
value {{ forceFocus }} <br/>
<input type="text" focus="{{ forceFocus }}" ng-blur="focus = false"><br />
<input type="text"><br />
<button ng-click="addClicked()">Add</button>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
@leonardocregis
leonardocregis / git - checkout
Last active January 26, 2017 10:55
some usefull ways to checkout: checking out files from other branchs, checkting out the file from the branch...
#several used ways to checkout
git checkout <filename>
#get a version from a branch
git checkout <branch> <filename>
#now its into the index, get it out of it , checking out from the index ;-)
git checkout-index
@wellingtonsv
wellingtonsv / linux - jboss - runing
Last active October 5, 2016 11:57 — forked from leonardocregis/linux - jboss - runing
Running jboss into linux, letting in run into the background and with a different config of config.xml
nohup ./standalone.sh -b 0.0.0.0 -server-config=standalonename.xml > /dev/null &
unzip <PATH_FILE>.zip - descompacta um arquivo zip
tar xzf <PATH_FILE>tar.gz - descompacta um arquivo tar.gz
#see the contents of the file only
unzip -vl file
@leonardocregis
leonardocregis / java - Maven - jar-manifest-MainClass
Last active April 8, 2017 18:56
Maven-Jar-Manifest-MainClass
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>propertiesreplicator.Replicator</mainClass>
#commandos do vi
:wq! (para salvar e sair)
@leonardocregis
leonardocregis / Testing - Path manager
Created December 14, 2015 17:12
A way to define better the path of the resources into a test
static {
dir = System.getProperty("user.dir") + "/src/test/resources/queue.xml";
}
Example for debug configurations
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044