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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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", |
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. |
https://github.com/rikukissa/redux-isolated-apps
http://redux.js.org/docs/recipes/IsolatingSubapps.html
Pros:
- Minimalistic approach, easy to understand
- Minimal code changes required when isolating pieces of UI
- Easy integration with redux-loop, redux-forms etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\[(\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)+ |
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. |
Lean unit tests with minimal setup