Skip to content

Instantly share code, notes, and snippets.

View thiago-vieira's full-sized avatar
🏴

Thiago Vieira thiago-vieira

🏴
View GitHub Profile
@thiago-vieira
thiago-vieira / remove_some_types.sh
Last active August 29, 2015 13:58
Remove some type of files in a folder tree
rm -rf `find /diretorio/que/quer/apagar/ -iname "*.extensao"`
# or
find ./ -type f -not -name "*.xls" -and -not -name "*.doc" -exec rm {} \;
@thiago-vieira
thiago-vieira / find.sh
Last active August 29, 2015 13:58
Finding all distinct file extensions in a folder hierarchy
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u
declare
l_MaxVal pls_integer;
l_Currval pls_integer default - 1;
begin
-- insert primary key and table name
select max(cod_os)
into l_MaxVal
from os;
while l_Currval < l_Maxval
loop
chrome.exe --restore-last-session
@thiago-vieira
thiago-vieira / schema_doc
Created January 13, 2015 19:34
Generate database schema document with search
select
TABLE_NAME,
decode(column_id,0,null,column_id) as COLUMN_ID,
COLUMN_NAME, NULLABLE, DATA_TYPE, COMMENTS
from (
select cc.TABLE_NAME,
tc.COLUMN_ID, tc.COLUMN_NAME,
tc.NULLABLE, tc.DATA_TYPE ||
case when tc.DATA_SCALE is not null then '(' || tc.DATA_PRECISION || ',' || tc.DATA_SCALE || ')'
when tc.DATA_PRECISION is not null then '(' || tc.DATA_PRECISION || ')'
@thiago-vieira
thiago-vieira / lightdm.conf
Created May 28, 2015 15:56
Disable users list and guest user - Ubuntu
#/etc/lightdm/lightdm.conf
[SeatDefaults]
greeter-hide-users=true
greeter-show-manual-login=true
allow-guest=false
@thiago-vieira
thiago-vieira / table_names_my_sql
Created June 9, 2015 17:17
Generate a .csv table names from a MySQL schema
SELECT GROUP_CONCAT(table_schema, '.', table_name)FROM information_schema.tables WHERE table_schema = 'database_name';
<style>
a.negrito { font-weight: bold; }
input.fundo_verde { background-color: #8CDFAD}
</style>
<script>
$(document).ready(function(){
$("input").focus(function(){
$(this).addClass("fundo_verde");
});
@thiago-vieira
thiago-vieira / application.html.erb
Created June 29, 2011 12:51
jQuery with Prototype
<!-- with gem "jquery-rails" -->
<%= javascript_include_tag :defaults %>
<script>jQuery.noConflict();</script>
<%= javascript_include_tag 'prototype' %>
@thiago-vieira
thiago-vieira / .nanorc
Created May 9, 2012 14:26
Nano Editor configuration
# ~/.nanorc
set const
set tabsize 2