Skip to content

Instantly share code, notes, and snippets.

@nabil-hassan
nabil-hassan / NameField.java
Last active September 16, 2015 18:38
GWT ValueAwareEditor Example
package net.nabilh.gwtsandbox.client.widgets.form.name;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.EditorDelegate;
import com.google.gwt.editor.client.ValueAwareEditor;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.ValueListBox;
@nabil-hassan
nabil-hassan / NumberField.java
Created September 16, 2015 10:21
GWT IsEditor Example
package net.nabilh.gwtsandbox.client.widgets.form;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.IsEditor;
import com.google.gwt.editor.ui.client.adapters.ValueBoxEditor;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
@nabil-hassan
nabil-hassan / PhoneNumberField.java
Created September 16, 2015 10:08
GWT LeafValueEditor Example
package net.nabilh.gwtsandbox.client.widgets.form.phone;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.*;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
@nabil-hassan
nabil-hassan / PhoneNumberListField.java
Last active September 16, 2015 10:01
GWT CompositeEditor Example
package net.nabilh.gwtsandbox.client.widgets.form.phone;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.CompositeEditor;
import com.google.gwt.editor.client.EditorDelegate;
import com.google.gwt.editor.client.LeafValueEditor;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
@nabil-hassan
nabil-hassan / FTPTransportTest.java
Last active December 6, 2019 03:26
Java FTP Client Demo
package net.nabilh.ftp;
import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.junit.Before;
import org.junit.Test;
@nabil-hassan
nabil-hassan / Install SVN 1.7 on Linux (Fedora)
Created September 18, 2014 22:02
Install SVN 1.7 on Linux (Fedora)
IntelliJ 12 does not support SVN 1.8.
To install SVN 1.76 on Linux (tested with Fedora)
# Remove SVN 1.8
sudo svn yum remove svn
# Download SVN 1.7 sources tar (check version link exists - may have changed)
cd /tmp && wget http://apache.mirror.anlx.net/subversion/subversion-1.7.18.tar.gz
tar -zxvf subversion-1.7.1.8.tar.gz
@nabil-hassan
nabil-hassan / sql-server-find-fk-referencing-pk.sql
Created August 7, 2014 10:01
SQL Server: Find all foreign key columns that reference primary key column
-- Find all fk columns that reference the specified PK column
DECLARE @BASE_TABLE_NAME VARCHAR(255) = 'RD_CLAIM_CLOSURE_REASON'
DECLARE @BASE_COLUMN_NAME VARCHAR(255) = 'ID'
SELECT r.TABLE_NAME fk_table_name,
r.COLUMN_NAME fk_column_name
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE U
INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS FK
ON U.CONSTRAINT_CATALOG = FK.UNIQUE_CONSTRAINT_CATALOG
AND U.CONSTRAINT_SCHEMA = FK.UNIQUE_CONSTRAINT_SCHEMA
@nabil-hassan
nabil-hassan / Install Oracle Virtual Box On Fedora 20
Created July 27, 2014 15:21
Install Oracle Virtual Box On Fedora 20
# Run these commands in a terminal to install Oracle Virtual Box on Fedora 20
# n.b. this install requires a restart mid-way through
# Install Virtual Box Repository
su root
cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
# Update packages and install dependencies & Virtual Box 4.3
yum update