Skip to content

Instantly share code, notes, and snippets.

View xlucasdemelo's full-sized avatar
🇪🇸

Lucas Aguiar xlucasdemelo

🇪🇸
View GitHub Profile
CREATE TABLESPACE bullion_tablespace
DATAFILE 'db2.dbf'
SIZE 40M ONLINE;
CREATE USER bullion IDENTIFIED BY bullion;
GRANT CONNECT, RESOURCE, DBA TO bullion;
GRANT UNLIMITED TABLESPACE TO bullion;
playerOne = ""
playerTwo = ""
def choosePlayer( player ):
var = raw_input("Player "+ player +": choose X or O: ").upper()
while (var != 'X' and var != 'O'):
var = raw_input("Player "+ player +": choose X or O: ").upper()
@xlucasdemelo
xlucasdemelo / Timescale
Created August 2, 2017 18:37
Timescale
SELECT equipment_attribute_id, max(value) as value, time_bucket('8 hour', created) AS created
FROM conatus.measurement
WHERE ( created >= (SELECT CURRENT_DATE - interval '1 month' ) AND equipment_attribute_id IN ( 89, 120, 108, 123, 122, 125, 124, 113, 1, 121, 168 ) AND value != 'NaN')
group by 3, equipment_attribute_id
ORDER BY 3
#Generate failsafe HTML
-U clean package integration-test -P sandbox surefire-report:failsafe-report-only
@xlucasdemelo
xlucasdemelo / dropSchemas.sql
Created February 21, 2017 19:43
Drop all schemas from a database postgresql
SET search_path = _global, pg_catalog;
CREATE OR REPLACE FUNCTION drop_all ()
RETURNS VOID AS
$$
DECLARE rec RECORD;
BEGIN
-- Get all the schemas
FOR rec IN
select distinct schemaname