Skip to content

Instantly share code, notes, and snippets.

@dvas0004
dvas0004 / TLN_real_estate.py
Created August 13, 2018 14:13
Tallinn Real Estate - Scraping data using python and visualization
# only python 3.6 supported
# sudo pipenv --python=3.6 install requests requests_html numpy
import requests
import numpy as np
from requests_html import HTMLSession
class KVBuilder:
def __init__(self):
import requests
import urllib
from datetime import datetime
queries = ['react', 'angular', 'java', 'python', 'linux', 'machine learning', 'nodeJS', 'sql', 'full stack', 'microsoft, active directory', 'aws', 'ethereum,bitcoin', 'blockchain', 'scrum,agile', 'android', 'ios,xcode', 'devops', 'php', 'laravel', 'elasticsearch', 'mongodb', 'golang', 'oscp,cissp', 'neural network', 'postgres,postresql', '.net', 'ruby', 'macos']
for query in queries:
filename = '/tmp/Estonia/Job Market Eval/{}.csv'.format(query.replace(',','_'))
@dvas0004
dvas0004 / howto_python_flask_iis_wfastcgi.md
Last active April 5, 2024 03:00 — forked from bparaj/howto_python_flask_iis_wfastcgi
Python Flask on IIS with wfastcgi

Assume IIS is installed. My machine already had IIs 8.5.

DV : Adding some notes when using MS IIS Express 10

Install Python

  1. Download web installer (Python 3.6.3).
  2. Run as Administrator.
  3. Select custom installation for all users.
  4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious.
@dvas0004
dvas0004 / ServerSideEvents.kt
Created July 9, 2018 10:42
Spring Reactive SSE Service Example (https://blog.davidvassallo.me/3170)
package io.cybersift.PcapParserWeb.services
import org.springframework.stereotype.Service
import reactor.core.publisher.Flux
import redis.clients.jedis.JedisPubSub
import reactor.core.publisher.FluxSink
import redis.clients.jedis.JedisPoolConfig
import redis.clients.jedis.JedisPool
internal class MyListener(fluxSink: FluxSink<String>) : JedisPubSub() {
package com.example.sse.routers
import com.example.sse.HomeHandler
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.MediaType
import org.springframework.web.reactive.function.server.HandlerFunction
import org.springframework.web.reactive.function.server.RequestPredicates
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.RouterFunctions
@dvas0004
dvas0004 / DefaultRouter.kt
Last active February 20, 2022 22:14
A clear, simple example of multipart file upload using Reactive Spring (http://blog.davidvassallo.me/2018/07/09/reactive-spring-webflux-multipart-file-upload/)
package com.example.FileUploadExample
import com.example.FileUploadExample.HomeHandler
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.MediaType
import org.springframework.web.reactive.function.server.HandlerFunction
import org.springframework.web.reactive.function.server.RequestPredicates
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.RouterFunctions
GET http://localhost:8080/actuator/metrics/http.server.requests
{
"name":"http.server.requests",
"measurements":[
{
"statistic":"COUNT",
"value":1
},
{
@Service
public class TokenCreator {
@Value("${jwtSecret}")
private String jwtSecret;
private Algorithm algorithm = null;
public TokenCreator() { }
@RestController
public class SecurityController {
@Autowired
private TokenCreator tokenCreator;
@Value("${google.client.id}")
private String GOOGLE_CLIENT_ID;
@Autowired
public class JWTFilter implements Filter{
private String jwtSecret;
public JWTFilter(String jwtSecret){
this.jwtSecret = jwtSecret;
}
@Override
public void destroy() {