Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kosecki123 on github.
  • I am piotrkosinski (https://keybase.io/piotrkosinski) on keybase.
  • I have a public key ASDHMdBDja_f076GvZBft9G5jNxv28XGueH-Lx357TaAqQo

To claim this, I am signing this object:

@kosecki123
kosecki123 / template.py
Created October 13, 2016 10:47
A template for creating multi worker for in-mem map, reduce processing.
import multiprocessing
import sys
import pytz
import pandas as pd
def processing_function(file_path):
#this function need to
# 1 read file from the file_path argument
# 2 extract data
# 3 cleanup with object types
@kosecki123
kosecki123 / wgetsite
Created September 13, 2016 11:37
Wget all files from listing
wget --execute="robots = off" --mirror --convert-links --no-parent --wait=5 <website-url>
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
using System;
using System.Collections.Concurrent;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using SayLight.Domain.Events;
using SayLight.Domain.Models;
using SayLight.Services.Abstract;
namespace SayLight.Services
(defn extract-temperature [{:keys [type res]}]
(let [value-index (index-of "temperature" type)
all-values (first-vals res)]
(nth all-values value-index)))
(defn extract-rain [res]
(:rain_live (first res)))
(defn get-measurements [{modules :modules, measures :measures}]
//==========================================
// Working fully self-contained paket based script
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@kosecki123
kosecki123 / proxy.fs
Created November 18, 2015 08:25
F# Service Proxy
module internal Proxy =
module Utils =
//creates instance of the client from wsdl provider
let createClient serviceInfo =
let endpointAddress = new EndpointAddress(serviceInfo.EndPointUrl)
let binding = new NetTcpBinding(MaxReceivedMessageSize = 131072L)
new WSDLServiceTypeWhatever(binding, endpointAddress)
let search serviceInfo query =
use client = serviceInfo |> Utils.createClient
@kosecki123
kosecki123 / palindrome.clj
Last active November 7, 2015 19:27
clojure palindrome
(def palindrome? (comp (partial apply =) (partial apply str) reverse))