Skip to content

Instantly share code, notes, and snippets.

View rikukissa's full-sized avatar
🍔

Riku Rouvila rikukissa

🍔
View GitHub Profile
@rikukissa
rikukissa / README.md
Last active September 19, 2019 07:04
Collection of code simplification and refactoring tips #best practices #refactoring #code review

logo


Collection of code simplification and refactoring tips

Want to write clean code? Well here's your chance. The following set of examples are practices that I've come across during my times as a programmer and that I believe in. At least at the moment. Please feel free to add comments, criticise my thinking and contribute to everyone's knowledge. I'm trying to find a better platform for these, but for now a gist should do. I'm doing this solely to document, analyse and share my own thinking, which oftentimes is quite unstructured. These days I'm not too fussed about the syntactical structures of the code, but would rather concentrate on painting the largest guidelines and deciding the direction I want my programming style to move towards.

@rikukissa
rikukissa / PrintDict.vba
Created August 16, 2018 13:08
Dictionary printer for Visual Basic
Function PrintDict(Dict as Dictionary, Optional ByVal Stack as String = "")
For Each Key In Dict.Keys()
If TypeOf Dict(Key) Is Dictionary Then
Debug.Print Stack & Key & ":"
PrintDict Dict(Key), Stack & " "
Else
Debug.Print Stack & Key & ": " & Dict(Key)
End If
Next
End Function
@rikukissa
rikukissa / flow.json
Last active February 11, 2018 14:38
Google face detection for Node-RED
[
{
"id": "d6e8fa47.38bfd8",
"type": "http request",
"z": "a2a19eb0.8be53",
"name": "Google Vision",
"method": "POST",
"ret": "obj",
"url":
"https://vision.googleapis.com/v1/images:annotate?key=AIAIAIAIAIAIAXYXYXYXYXYXYXYXYXY",
@rikukissa
rikukissa / _touchbar.png
Last active December 26, 2017 15:03
Crypto ticker for MacBook Touch Bar
_touchbar.png
@rikukissa
rikukissa / POST.md
Last active July 21, 2019 19:26
Scaling a Redux app - reusable containers #redux
title slug createdAt language preview
Scaling a Redux app - reusable containers
scaling-a-redux-app-reusable-containers-redux
2017-11-12T14:11:50Z
en
The idea here is to experiment with building Redux applications by reusing Redux applications. So basically a classic Yo Dawg situation. I'm doing this in the name of science and in the hope that future generations would have a more structured way of building user interfaces.

Scaling a Redux app - reusable containers

@rikukissa
rikukissa / widgets.md
Last active August 26, 2017 15:47
Creating isolated Redux widgets
@rikukissa
rikukissa / README.md
Last active March 31, 2017 20:15
How to install React Native tvOS example with Xcode 7.3.1

1. Clone repository, install dependencies & start the development server

git clone git@github.com:deanmcpherson/react-native-tvos-example.git
cd react-native-tvos-example
npm install
npm start

Open ios/townskTV.xcodeproj in Xcode

@rikukissa
rikukissa / gist:594b0aef57b90db3be12
Created January 20, 2016 18:48
Skype log message regexp
\[(\d{1,2}\.\d{1,2}\.\d{4}\s\d{1,2}:\d{1,2}:\d{1,2})\]\s([a-ö1-9\s]+):\s((?!\[\d{1,2}\.\d{1,2}\.\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}).|\n)+
@rikukissa
rikukissa / POST.md
Last active January 27, 2020 08:10
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom #angular.js #testing
title slug createdAt language preview
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom
unit-testing-angular-js-app-with-node
2015-07-05T18:04:33Z
en
Majority of search result about unit testing Angular.js apps is about how to do it by using test frameworks that run the tests in a real browser. Even though it's great to be able to test your code in multiple platforms, in my opinion it creates a lot of boilerplate code and makes it hard to run the tests in, for instance a CI-server.

Testing Angular.js app headlessly with node.js + mocha

Lean unit tests with minimal setup

@rikukissa
rikukissa / subcomponent-styles.md
Last active August 29, 2015 14:23
Defining context-specific styles for subcomponents

Defining context-specific styles for subcomponents

i.e. benefits of using variables as selectors for components

File structure

components/
  button/
    index.styl
 index.js