Skip to content

Instantly share code, notes, and snippets.

View tfoldi's full-sized avatar

Földi Tamás tfoldi

View GitHub Profile
@tfoldi
tfoldi / tableau.clj
Created March 20, 2015 22:52
Tableau Server Rest API from Clojure - Example
(ns tabsync.tableau
(:require [clj-http.client :as client]
[clojure.zip :refer [xml-zip]]
[clojure.data.zip.xml :refer [xml-> xml1-> attr ]]
[clojure.data.xml :as xml])
)
(defn tableau-url-for
"Constructs server API url. Target can be hostname or session returned from logon-to-server"
[target api-path]
@tfoldi
tfoldi / pgpydl.sql
Created April 1, 2015 17:22
Python example of getting files and parsing them inside postgres database
CREATE OR REPLACE FUNCTION from_url(
-- The URL to download.
IN url text,
-- The maximum number of bytes to download.
-- If 0 then the whole response is returned.
IN max_bytes integer DEFAULT 0,
-- Should any errors (like HTTP transport errors)
-- throw an exception or simply return default_response
IN should_throw boolean DEFAULT true,
-- The default response if any errors are found.
@tfoldi
tfoldi / MakeOrder.java
Created May 4, 2015 11:15
Compare Java and Clojure Tableau TDE API
// -----------------------------------------------------------------------
// The information in this file is the property of Tableau Software and
// is confidential.
//
// Copyright (C) 2012 Tableau Software.
// Patents Pending.
// -----------------------------------------------------------------------
// externalapi/samples/com/tableausoftware/demos/MakeOrder.java
// -----------------------------------------------------------------------
package com.tableausoftware.demos;
@tfoldi
tfoldi / WebServiceClient.java
Created July 13, 2015 17:09
Trigger a schedule
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
@tfoldi
tfoldi / tableau-password-validator-full.js
Created August 4, 2015 13:18
Tableau Password Validation Full
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var jade = require("jade/runtime");
module.exports = function template(locals) {
var jade_debug = [ new jade.DebugItem( 1, "/home/t/git/tableau-server-password-validator/coffee/tableau-server-password-validator/messages.jade" ) ];
try {
var buf = [];
var jade_mixins = {};
var jade_interp;
@tfoldi
tfoldi / t__keyspace.cpp
Created May 2, 2010 11:17
Test cases for memcached vs keyspaced comparsion
#include <codesloop/common/test_timer.h>
#include <codesloop/common/logger.hh>
#include <codesloop/common/common.h>
#include <keyspace_client.h>
#include <assert.h>
#include <vector>
@tfoldi
tfoldi / yxlan_cron.rb
Created May 18, 2010 10:49
smbclient based sync between windows and unix
#!/usr/bin/ruby
#
# Foldi Tamas <tfoldi@xsi.hu>, BSDL
require "yaml"
# read configuration
@yxlan_dir = File.dirname($0) + "/../"
@conf = YAML::load_file( @yxlan_dir + 'etc/yxlon.conf' )
@filename = @yxlan_dir + "log/yxlon_cron.log"
CREATE OR REPLACE PACKAGE BODY ISZMETL.etl_employee IS
PROCEDURE main( p_params param_list DEFAULT NULL ) IS
v_params obj_param := iszmk.obj_param( p_plist => p_params );
v_logger obj_logger;
v_stmt VARCHAR2( 100 );
BEGIN
/*** AUTOMATICALLY GENERATED PROCEDURE ***/
/*** DO NOT CHANGE IT ***/
v_start_date := sysdate;
%YAML 1.1
---
VERSION: 1.0.0.1
DEFINE:
- INPUT:
NAME: book
FILE:
# change seghostname and file_path to reflect your
# runtime file location
@tfoldi
tfoldi / geomean.sql
Created October 7, 2010 14:53
Aggregate function for geometric mean (GEOMEAN) for Oracle RDBMS
ALTER SESSION SET plsql_compiler_flags = 'NATIVE';
--
ALTER TYPE geomean_impl COMPILE;
--
CREATE FUNCTION geomean( input NUMBER )
RETURN NUMBER
PARALLEL_ENABLE
AGGREGATE USING geomean_impl;