Skip to content

Instantly share code, notes, and snippets.

View andrea-ale-sbarra's full-sized avatar
🎯
Focusing

Andrea Sbarra andrea-ale-sbarra

🎯
Focusing
View GitHub Profile
export JPDA_ADDRESS=8000 && \
export JPDA_TRANSPORT=dt_socket && \
export JPDA_SUSPEND=y && \
./catalina.sh jpda start && tail -f ../logs/catalina.out
@andrea-ale-sbarra
andrea-ale-sbarra / import keystore
Created August 9, 2017 13:13
import pfx keystore into cacerts
keytool -importkeystore -srckeystore KEYSTORE.pfx -srcstoretype pkcs12 -keystore cacerts -srcalias "blah" -destalias "blah"
@andrea-ale-sbarra
andrea-ale-sbarra / inputs.html
Created July 24, 2017 08:56
manage field via vue and checkbox
<div style="clear: both;"></div><br/>
<div class="control-group" id="enabledNotificationGroup">
<label class="control-label" for="enabledNotification">Enable Email Notification:</label>
<div class="controls">
<input type="checkbox" class="form-control input-xxlarge" th:field="*{enabledNotification}" id="enabledNotification" v-model="isEnabled" v-on:click="eraseValue" />
<span class="help-inline">
<span th:each="err : ${#fields.errors('enabledNotification')}" th:text="${err}"></span>
</span>
</div>
</div>
@andrea-ale-sbarra
andrea-ale-sbarra / from_varchar_to_clob.sql
Created July 13, 2017 07:23
Sql script that converts one column from varchar to clob.
ALTER TABLE NP_SUSP_TRANS_REP ADD ("REASONS_REMIT_BREACH_N" CLOB NULL) LOB
(
"REASONS_REMIT_BREACH_N"
)
STORE AS
(
TABLESPACE "notif_dat" RETENTION ENABLE STORAGE IN ROW NOCACHE
);
UPDATE NP_SUSP_TRANS_REP SET "REASONS_REMIT_BREACH_N" = "REASONS_REMIT_BREACH";
-- ALTER TABLE "ARIS_STG".trs_fund_storage_unavail MODIFY ("unavailabilityDescrN" NOT NULL);
@andrea-ale-sbarra
andrea-ale-sbarra / read topic from beginning
Last active April 6, 2017 08:06
Login to Kafka docker and read topic from beginning.
ALERT TOPIC
docker exec -it kafka bash
kafka-console-consumer --zookeeper zookeeper:2181 --topic rule-11835 --from-beginning
EMT TOPIC
docker exec -it kafka bash
kafka-console-consumer --zookeeper zookeeper:2181 --topic rule-46826 --from-beginning
@andrea-ale-sbarra
andrea-ale-sbarra / preselect value in select tag with angular
Created August 31, 2016 07:22
I have a team instance in user and a list of teams from which I should preselect the value to show in my option.
<select ng-options="option.name for option in $ctrl.teams track by option.id" ng-model="user.team"></select>
@andrea-ale-sbarra
andrea-ale-sbarra / keyboard configuration
Created July 15, 2016 09:16
on vagrant box run this command to configure keyboard
sudo dpkg-reconfigure keyboard-configuration
@andrea-ale-sbarra
andrea-ale-sbarra / ReadProperties.java
Created May 17, 2016 13:20
read .properties from classpath
Properties prop = new Properties();
InputStream input = null;
try {
String filename = "config.properties";
input = this.getClass().getClassLoader().getResourceAsStream(filename);
if (input == null) {
System.out.println("Sorry, unable to find " + filename);
throw new java.lang.UnsupportedOperationException("Some errors occurred, please try again later.");
cd apache-tomcat\bin
set JPDA_SUSPEND=y
catalina.bat jpda run
@andrea-ale-sbarra
andrea-ale-sbarra / NSDate extension
Created July 21, 2014 20:08
Estendere la NSDate in swift e settaggi utili
extension NSDate
{
convenience
init(dateString:String) {
let dateStringFormatter = NSDateFormatter()
dateStringFormatter.dateFormat = "yyyy-MM-dd"
dateStringFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
let d = dateStringFormatter.dateFromString(dateString)
self.init(timeInterval:0, sinceDate:d)
}