Skip to content

Instantly share code, notes, and snippets.

Working from home

Leo Dutra leodutra

Working from home
View GitHub Profile
leodutra / supports-post-object.js
Last active Aug 29, 2015
Check if HTML5 postMessage supports object serialization.
View supports-post-object.js
var supportsPostObject = false;
if (window.postMessage) {
var oldIE = false;
var callback = function(e) {
supportsPostObject = typeof( !== 'string';
leodutra / delete-stuff.bat
Last active Aug 29, 2015
Batch for deleting files and folders recursively on Windows.
View delete-stuff.bat
@echo off
set foldername=%1
:: Remove files before removing their folders. It's faster
DEL /F /Q /S %foldername%\*
:: "RD" is much more fast than "RMDIR"
for /D %%i in ("%foldername%\*") do RD /S /Q "%%i"
leodutra / data-fill-till-bottom.js
Created Feb 12, 2015
Data-attribute bind functionality: fill available window area using the target element.
View data-fill-till-bottom.js
$(document).ready(function() {
var $filler = $('[data-fill-till-bottom]');
$filler.height($(window).height() - $filler.offset().top);
leodutra /
Last active Aug 29, 2015
Simple NodeJS/IOJS ODBC DB2 config Ubuntu 14.04
# first download and install IBM Data Server Driver Package CLI/Packages
apt-get install iojs npm git unixodbc unixodbc-dev -y
git clone git://
cd node-odbc
node-gyp configure build
npm install odbc
leodutra / ubuntu-14-subclipse-1.10-tutorial.txt
Last active Aug 29, 2015
Configure JavaHL 1.8 for Subclipse 1.10
View ubuntu-14-subclipse-1.10-tutorial.txt
// reference:
Install inside RAD 8.5:
Install JavaHL dependencies:
sudo apt-get install libsvn-java -y
Find installation path
sudo find / -name
leodutra / first-input-focus.js
Last active Aug 29, 2015
Focus first form input field using jQuery
View first-input-focus.js
function focusFirstInput($root) {
$(':input', $root).not('[type="hidden"], button').first().focus();
leodutra /
Created Apr 28, 2015
Netspeed indicator for Ubuntu 14.04
add-apt-repository ppa:nilarimogard/webupd8
apt-get update
apt-get install indicator-netspeed
leodutra / eclipse-rad-swt-process-browser-fix
Created May 8, 2015
Eclipse/RAD SWT Browser Path Error Fix
View eclipse-rad-swt-process-browser-fix
Q: What do I need to run the SWT Browser in a standalone application on Linux or Solaris?
A: Follow the steps below to use the SWT Browser widget in your standalone SWT application.
A supported native browser must be installed (linux requirements) (solaris requirements).
If a supported WebKitGTK and/or XULRunner is installed then it should be found automatically at runtime with no additional effort. For other native Mozilla-based browsers:
Set the environment variable MOZILLA_FIVE_HOME to the native browser's installation folder. e.g. setenv MOZILLA_FIVE_HOME /usr/lib/mozilla
Set the environmnent variable LD_LIBRARY_PATH to include MOZILLA_FIVE_HOME. e.g. setenv LD_LIBRARY_PATH ${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
Your standalone SWT application can now use the Browser widget.
leodutra /
Created May 10, 2015
Remove GEdit Linux Text Editor Tilde Backup Files (ended with "~")
cd /home
rm -i `find -name '*~'`