Skip to content

Instantly share code, notes, and snippets.

View brenopolanski's full-sized avatar
🦙
Llama Llama

Breno Polanski brenopolanski

🦙
Llama Llama
View GitHub Profile
@brenopolanski
brenopolanski / queries.md
Created March 24, 2018 17:56
Example Apache Drill queries
CREATE VIEW dfs.tmp.test_view AS SELECT employee_id, full_name, position_title, salary FROM cp.`employee.json`

SELECT * FROM dfs.tmp.test_view LIMIT 20
@brenopolanski
brenopolanski / index.html
Created March 14, 2018 13:32
Udacity Mockup to Article
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Humans vs Machines Blog</title>
</head>
<body>
<article>
<header>
<h1>Humans vs. Machines: An AI Odyssey</h1>
@brenopolanski
brenopolanski / fill_in_the_blanks.py
Created March 12, 2018 17:50
Code Your Own Quiz
EASY_MAD_LIB = """HyperText Markup Language (___1___) is the standard markup
language for creating web pages and web applications. With Cascading Style
Sheets (___2___), and ___3___, it forms a triad of cornerstone technologies
for the World Wide Web. Web browsers receive ___1___ documents from a webserver
or from local storage and render them into multimedia web pages. ___1___
describes the structure of a web page semantically and originally included cues
for the appearance of the ___4___."""
EASY_ANSWERS = ["HTML", "CSS", "JavaScript", "document"]
MEDIUM_MAD_LIB = """___1___ is a widely used high-level, general-purpose,
@brenopolanski
brenopolanski / gist:9c8681e8e22e531594015219b7229c73
Created February 18, 2018 16:57 — forked from Steven-Rose/gist:3943830
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.
@brenopolanski
brenopolanski / gist:e59a68b1cb4aabafbcb0dca32f0e347f
Created January 17, 2018 17:50 — forked from pstoellberger/gist:3899805
Conditional Formatting in Saiku
In the mondrian schema xml:
-----------------------------------------------------------------------------------------------------------
<CalculatedMember
name="Profit"
dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" expression="Iif(([Measures].[Store Sales] - [Measures].[Store Cost]) &lt; 10000, '|(#,##0.00 &#8364;)|style=red', '|#,##0.00 &#8364;|style=green')"/>
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/>
</CalculatedMember>
@brenopolanski
brenopolanski / server.js
Created December 26, 2017 20:03
Simple static files with node
const path = require('path');
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;
app.use('/', express.static(`${__dirname}/public`));
// express will serve up index.html if it doesn't recognize the route
app.get('*', (req, res) => {
@brenopolanski
brenopolanski / export-svg-inkscape.md
Created December 26, 2017 13:29
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@brenopolanski
brenopolanski / index.html
Created December 21, 2017 23:19
Demo using OZP IWC intents + Saiku + Time Series Filter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<!-- CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
@brenopolanski
brenopolanski / add-option-to-dropdown.js
Created November 28, 2017 12:42 — forked from paulund/add-option-to-dropdown.js
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@brenopolanski
brenopolanski / docker-cp-container-host.md
Created November 2, 2017 17:37
Docker - copy file from container to host

In order to copy a file from a container to the host, you can use the command:

docker cp <containerId>:/file/path/within/container /host/path/target