Skip to content

Instantly share code, notes, and snippets.

View BorisKozo's full-sized avatar

Boris Kozorovitzky BorisKozo

  • Micro Focus
  • Israel
View GitHub Profile
@BorisKozo
BorisKozo / cover.go
Last active June 21, 2017 09:39
A utility script that runs Go (Golang) coverage report on all the packages within a directory excluding vendor. Note that each package will only show coverage of itself when run (no cross package coverage)
package main
import (
"fmt"
"path/filepath"
"os"
"log"
"strings"
"os/exec"
"bufio"
@BorisKozo
BorisKozo / app.js
Created April 2, 2017 09:06
Getting Tableau data from Node.js
//We use this code to retrieve data directly from Tableau server 10.1 from our Node.js server
//This is just a simplified example, not the actual code :)
// You need to fill in all the things in < >
const tableauServer = 'https://<IP OF YOUR SERVER>/trusted';
const username = '<username of a valid user to view the data>';
const reportPath = '/views/<WORKBOOK>/<view>';
const request = require('request-promise-native');
//This is optional, you can add filter parameters directly into the URL
//Check if you need to URI encode the parameter value
@BorisKozo
BorisKozo / README-Template.md
Created March 29, 2017 05:56 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@BorisKozo
BorisKozo / gist:7869144
Created December 9, 2013 08:36
A PowerShell script by Leniel Macaferi to add a header to all .cs files in a directory
param($target = "C:\MyProject", $companyname = "My Company", $date = (Get-Date))
$header = "//-----------------------------------------------------------------------
// <copyright file=""{0}"" company=""{1}"">
// Copyright (c) {1}. All rights reserved.
// <author>Leniel Macaferi</author>
// <date>{2}</date>
// </copyright>
//-----------------------------------------------------------------------`r`n"
function Write-Header ($file)
@BorisKozo
BorisKozo / main.js
Last active December 18, 2015 13:19 — forked from smykes/main.js
var AppRouter = Backbone.Router.extend({
routes: {
"" : "list",
"clients/:id" : "clientDetails"
},
initialize: function () {
},
list: function(page) {
$('#header').html(new HeaderView().render().el);
@BorisKozo
BorisKozo / gist:3313164
Created August 10, 2012 10:10
Calculating Fibonacci asynchronously
var data = [0,1];
function retrieveData(callback){
var x = data[data.length - 1];
var y = data[data.length - 2];
setTimeout(function(){
callback(x,y);
},0);
}