Skip to content

Instantly share code, notes, and snippets.

View kasperosterbye's full-sized avatar

Kasper Østerbye kasperosterbye

View GitHub Profile
@kasperosterbye
kasperosterbye / gist:d8c9bd518fba68289c9f129d553ad6b6
Last active October 17, 2019 16:36
String concatenation vs. Stream

This is an old one, and I knew that one should not use #, when you can use streams instead.

But that is was this bad to use #, came as a surprise I must say:

(5000 to: 30000 by: 5000) collect: [ :N |
	strings := (1 to: N) collect: [ :i | 'string',i printString ].

	N -> ((((1 to: 20) collect: [:dummy | 
 Time millisecondsToRun: [ strings inject: '' into: [ :sofar :each | sofar , each ] ]
@kasperosterbye
kasperosterbye / gist:8c1c97d95a7cee0dca5a2e9d885e37b9
Last active September 27, 2021 05:51
Testting ground for markdown

Can we have bold with italics inside , or how

  • List element With more text

    And a new paragraph.
    With a line return

  • and a new item

  • with sub item