Skip to content

Instantly share code, notes, and snippets.

View juusaw's full-sized avatar

Juuso Mikkonen juusaw

View GitHub Profile

Keybase proof

I hereby claim:

  • I am juusaw on github.
  • I am juusaw (https://keybase.io/juusaw) on keybase.
  • I have a public key ASC01lFVOakCg1NsrKRuZ0HUHdx20ZjQCiG_0d6Et_UdzAo

To claim this, I am signing this object:

@juusaw
juusaw / chatbot.py
Created June 12, 2017 19:08
MB chatbot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer, ChatterBotCorpusTrainer
bot_name = 'Mikrobitti'
trainer = 'corpus'
bot = ChatBot(
bot_name,
@juusaw
juusaw / actionCreators.js
Created February 5, 2017 15:33
Action creator for react-router-redux path change
import { push } from 'react-router-redux'
/**
* Action creator to perform a route change from a component.
* Simply pass the action creator to the component and call it
* like `this.props.routePath('/route/here')`
*
* @param {string} path The path to navigate to.
*
* @return {Object} Action to dispatch for route change.
@juusaw
juusaw / scroll.js
Last active December 15, 2018 12:20
Animated scroll to target in pure JS
var links = document.getElementsByClassName('scroll-link');
for (var i = 0; i < links.length; i++) {
links[i].onclick = scroll;
}
function scroll(e) {
e.preventDefault();
var id = this.getAttribute('href').replace('#', '');
var target = document.getElementById(id).getBoundingClientRect().top;
@juusaw
juusaw / affirmation
Created May 14, 2016 07:49
MuleSoft Contributor Agreement Acceptance by Juuso Mikkonen
I, Juuso Mikkonen, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Sat May 14 2016 10:48:56 GMT+0300 (EEST)