Skip to content

Instantly share code, notes, and snippets.

View aaguilera's full-sized avatar

Angel Aguilera aaguilera

View GitHub Profile
@aaguilera
aaguilera / grant_acl_oracle11g.sql
Last active August 29, 2015 14:04
Grant access to network resources in Oracle 11g
--
-- Oracle 11g
-- Grant access for user 'SCOTT' to access port 25 on server 'mail.example.com'.
-- This script should be run as user 'SYS'.
--
DECLARE
v_username VARCHAR2(100) := 'SCOTT';
v_acl VARCHAR2(100) := 'mail_access.xml'; -- ACL names should end with '.xml'
v_description VARCHAR2(255) := 'Permission to access mail server.';
v_host VARCHAR2(100) := 'mail.example.com';
@aaguilera
aaguilera / stylish_html_input_file.md
Last active August 29, 2015 14:08
Stylish HTML <input type="file">

Stylish HTML file input field

HTML

The idea is to hide the <input type="file"> field (which look&feel varies from browser to browser), and use a label element (which we can style using CSS) to trigger the file selector:

<label for="fileupload" style="some_cool_CSS_code">Choose file</label>
<input id="fileupload" type="file" name="fieldname" style="display:none">

Optional enhancement

@aaguilera
aaguilera / field.plsql
Last active August 29, 2015 14:21
Convert string into a suitable CSV field as expected by MS Excel
--
-- Convert string into a suitable CSV field as expected by
-- Microsoft Excel.
-- See http://stackoverflow.com/a/21749399/1314986.
--
FUNCTION field(str IN VARCHAR2) RETURN VARCHAR2 IS
C_NEWLINE CONSTANT CHAR(1) := '
'; -- newline is intentional
v_aux VARCHAR2(32000);
@aaguilera
aaguilera / dell_customizations.md
Last active April 8, 2017 13:24
Dell XPS 13 customizations for Ubuntu

Via command-line

Disable bluetooth:

/usr/sbin/rfkill block bluetooth

Set screen brightness:

/bin/echo 50 > /sys/class/backlight/intel_backlight/brightness
@aaguilera
aaguilera / keybase.md
Created April 3, 2018 08:53
Keybase verification

Keybase proof

I hereby claim:

  • I am aaguilera on github.
  • I am aaguilera (https://keybase.io/aaguilera) on keybase.
  • I have a public key ASD2_Tjsabplz-7fqxYm6ab04jpaq45Or9LNEvF9G0p0pQo

To claim this, I am signing this object:

@aaguilera
aaguilera / caminstech-eclipse-formatter-java.xml
Last active August 12, 2019 14:31
CaminsTECH Java coding style (for Eclipse IDE)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="16">
<profile kind="CodeFormatterProfile" name="CaminsTECH - Java" version="16">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
BEGIN MESSAGE.
w09MrUtY2L8Kcr8 fLFwQWTbufoW7DN hsJyyrqaGwITOHd 7GwlW4g8MgUWAzd
eJzEHwWRvvEc93f OP5aGFqZVY3TCKq 6Xr2MZHgg4efucb vl17KCkvKbCeFIz
F0hskKpwVBuI4tC FYfkBfLe8uYYQ0M DcsyJqmGSN7lmNN 526coiMRNQgSEEc
XTq5m4rJWF81g1u L12CkaW0J9DqGkD zM9Hc29HFxl.
END MESSAGE.
@aaguilera
aaguilera / linguistic_sort_sample.sql
Created June 30, 2020 06:26
Linguistic sort with Oracle
--
-- Sort using catalan rules
--
SELECT *
FROM software
ORDER BY NLSSORT(nom, 'NLS_SORT=catalan');
@aaguilera
aaguilera / retext.css
Created September 13, 2021 10:25 — forked from elclanrs/retext.css
Markdown theme for ReText
body {
color: #333;
font: normal 16px/1.3 Arial, sans-serif;
max-width: 6.5in;
margin: 0 auto;
}
a:link, a:visited {
color: #1B70D1;
text-decoration: none;
@aaguilera
aaguilera / spreadsheet2csv.txt
Last active February 1, 2022 22:30
Transforma un full de càlcul (XLS) a CSV amb Libreoffice amb sortida en UTF-8
#
# Adaptat d'una versió per a MacOS: https://gist.github.com/jhanschoo/bcd6d08d1e0f4b5d52735287f39ca924
#
# És de suposar que funcionaria amb tots els fulls de càlcul que suporti LibreOffice, no només amb XLS
libreoffice --headless --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,1/1:" fitxer.xls