Skip to content

Instantly share code, notes, and snippets.

View crawl-gx-dataviews.user.js
// ==UserScript==
// @name crawl-gx-dataviews
// @namespace Utils
// @description crawl-gx-dataviews
// @include http://10.20.30.214/app/Dataviews.html
// ==/UserScript==
with(document)
{
titles = getElementsByClassName("titulosRosaBgc");
View gist:1146821
SELECT
"jobs".*
FROM
"jobs"
INNER JOIN "skill_sets"
ON "skill_sets"."source_id" = "jobs"."id"
AND "skill_sets"."source_type" = 'Job'
INNER JOIN "skills"
ON "skills"."id" = "skill_sets"."skill_id"
@felclef
felclef / Jobs_Skills_and_Candidates.sql
Created Aug 15, 2011
A script for Elland's sake. I hope it helps :D
View Jobs_Skills_and_Candidates.sql
/**
* This sh*t is a dummy query to help a jenius fréndo
*
* The problem: get a dataset with the Job vs Candidate - Skill analysis, and answer: which candidate better fits the given job skills?
*
* Consider:
* - A Job is composed by many Skills
* - And so is the Candidate...
*
* Use your imagination, cuz this is just a dummy script, I wont create any schema... >:D
View elland.skill.candidate.sql
SELECT
jb.*
FROM
jobs jb
INNER JOIN jobs_skills jbs
ON jbs.job_id = jb.id
INNER JOIN skills skj
ON skj.id = jbs.skill_id
LEFT JOIN (
@felclef
felclef / oraexpy.py
Created Sep 23, 2011
Oracle exp over py yay =D
View oraexpy.py
# -*- coding: cp1252 -*-
import os
import time
import re
import cx_Oracle
class Exec:
debug = True
@staticmethod
@felclef
felclef / eq2.py
Created Oct 4, 2011
Uma brincadeira com bhask-sei-lá-quem-indiano e as equações de 2o grau, pra explicar python prum amigo aí ;D
View eq2.py
# a * x**2 + b * x + c = 0, a != 0
# (-b +- sqrt(d) ) / 2 * a
# d = b**2 - 4 * a * c
from math import sqrt
#print 3 ** 2
#print sqrt(9)
def get_d(a, b, c):
return ( b ** 2 ) - ( 4 * a * c )
@felclef
felclef / ora_tab_cons.sql
Created Nov 8, 2011
how to become a god in a hell look-a-like db
View ora_tab_cons.sql
select
tb.table_name, count(*) as num_cons
from
user_tables tb
inner join user_constraints ct
on ct.table_name = tb.table_name
inner join user_cons_columns cc
on cc.constraint_name = ct.constraint_name
and cc.table_name = ct.table_name
where
@felclef
felclef / ora_udt_all_fields.sql
Created Nov 11, 2011
Atualizando um campo no banco todo. O banco é mal-feito...
View ora_udt_all_fields.sql
declare
cursor c_sql_stmt is
select
cl.table_name,
cl.column_name,
'UPDATE '||cl.table_name||' set '||cl.column_name||' = :1 where regexp_like('||cl.column_name||', :2, ''i'')' as cmd
from
user_tab_columns cl
inner join user_tables tb
on tb.table_name = cl.table_name
@felclef
felclef / SQL.sublime-build
Created Nov 11, 2011
Sublime Text Editor - build for using SQL scripts with Oracle SQL*Plus (change the dummy for your conn)
View SQL.sublime-build
{
"cmd": ["sqlplus", "dummy/dummy@local", "@$file"],
"selector": "source.sql",
"encoding": "cp1252"
}
@felclef
felclef / ora_compile.sql
Created Nov 11, 2011
Compilar todos os objetos no Oracle...
View ora_compile.sql
begin
for cur_rec in
(
select
object_name,
object_type
from
user_objects
where
status <> 'VALID'