Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
peteruhnak / Roassal questions.md
Last active September 14, 2016 11:37
Roassal questions

Roassal questions

Q: What is the exact difference between Equidistant and Weighted layouts?

Q: Why is RTHorizontalFlowLayout named horizontal, if it flows in columns from top to bottom?

My expectation (and Kilon's as well) is that the name should be based on elements flow. So since elements in RTHorizontalFlowLayout flow from top to bottom, RTVerticalFlowLayout seems more correct.

For comparision:

@peteruhnak
peteruhnak / Pharo diffs without FileTree metadata.js
Last active September 14, 2016 11:31
Removes all diffs that are not .st or README.md file changes.
javascript:(function()%7Bif (window.location.href.match(%2Fhttps%3A%5C%2F%5C%2Fgithub.com%2F)) %7B %24('div.file-header').filter('%3Anot(%5Bdata-path%24%3D".st"%5D)').filter('%3Anot(%5Bdata-path%24%3D"README.md"%5D)').parent().toggle()%3B %7D%7D)()
@peteruhnak
peteruhnak / psh
Created February 12, 2016 23:11
pharo-scripting
#!/bin/sh
# place me in $PATH
set -e
if [ -z "$1" ]; then
echo "Missing script file"
exit 1
fi
@peteruhnak
peteruhnak / StHubToGitHub.st
Last active August 18, 2017 12:31
Copy a project from SmalltalkHub to GitHub
"Based on Uko's script https://gist.github.com/Uko/6898022"
"Get reference to the source repository"
source := MCSmalltalkhubRepository allInstances detect: [ :each |
each location includesSubstring: 'StName/project-name'
].
"Get reference to the target repository"
destination := MCFileTreeGitRepository allInstances detect: [ :each |
each location includesSubstring: 'project-name/repository'
@peteruhnak
peteruhnak / assign-reifs.png
Last active September 14, 2016 11:30
MetaLinks notes
assign-reifs.png
@peteruhnak
peteruhnak / Nautilus Shortcuts.md
Last active April 5, 2019 22:36
Pharo Nautilus Shortcuts Cheatsheet

Nautilus Shortcuts Cheatsheet

All shortcut keys are with the Meta key, e.g. F P = Meta+F Meta+P.

Meta key depends on your platform (Ctrl for Linux, Alt for Windows).

Running shortcuts from code editor

Unfortunately when you are in the source code editor, the editor will consume most of the shortcuts which is annoying as **** (some, such as running tests seems to always work though).

v := RTView new.
"o := TRAnnouncingOverseer new.
v canvas eventOverseer: o.
o announcer inspect."
droppable := RTBox new
size: 300;
borderColor: Color black;
elementOn: 'drop here'.
@peteruhnak
peteruhnak / selectors.txt
Created September 14, 2016 11:27
Pharo UIManager API notes
abort:
abort:title:
alert:
alert:title:
confirm:
confirm:label:
* label is actually a title, returns true/false
confirm:orCancel:
* the same, except returns the result of cancelBlock
confirm:trueChoice:falseChoice:
"For more than 1 depth stencilling (form with alpha for example). use rule 37"
| stencil blitter output color |
color := Color orange.
stencil := Form extent: 32@32 depth: 32.
(FormCanvas on: stencil)
fillOval: (1@1 corner: 31@31)
color: (Color white alpha: 0.5)

lockSurfaces.st#L68

sourceHandle := interpreterProxy fetchInteger: FormBitsIndex ofObject: sourceForm.

The above returns 0 just before the crash; the surface was NOT GCed however.

sourceForm was retrieved from here loadBitBltFrom.warping..st

sourceForm := interpreterProxy fetchPointer: BBSourceFormIndex ofObject: bitBltOop.